]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Tue, 1 Jul 2008 07:58:26 +0000 (07:58 +0000)
committerguigues <guigues>
Tue, 1 Jul 2008 07:58:26 +0000 (07:58 +0000)
12 files changed:
kernel/appli/CMakeLists.txt
kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in
kernel/appli/bbCreatePackage/bbCreatePackage.sh.in
kernel/appli/bbStudio/CMakeLists.txt [new file with mode: 0644]
kernel/appli/bbStudio/bbStudio.cxx [new file with mode: 0644]
kernel/install/gnome/CMakeLists.txt
kernel/install/gnome/bbStudio.desktop.in [moved from kernel/install/gnome/bbed.desktop.in with 65% similarity]
kernel/install/gnome/bbtk-install-gnome.sh.in
kernel/src/bbtkExecuter.cxx
kernel/src/bbtkFactory.cxx
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkWxGUIScriptingInterface.cxx

index fa74e8d8c2397784c101600b0e1f4203fb7511ac..f2e4ae10f99cd846d6963ca54c433d98ba18bc36 100644 (file)
@@ -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)
index 332f0387174d95b934dd35be57f030e567b41c41..75c45951b45a60f93195beeeebc285bcdaa7bffa 100644 (file)
@@ -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
index 6a026459f592b7dc2bc58868cf00f02fd6b9f828..d5e84f0a2e5b191f6d4858e79bd76cb4db15979d 100755 (executable)
@@ -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 (file)
index 0000000..99f7d87
--- /dev/null
@@ -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 (file)
index 0000000..b994e49
--- /dev/null
@@ -0,0 +1,119 @@
+#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_
+
+
+
index 8be0bb95998624e4b8e7a69d48c5a87de31038c0..08379b80016ef2d6f8bacaeccb077cf03de1ab1d 100644 (file)
@@ -8,7 +8,7 @@ CONFIGURE_FILE(
 )
 
 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(
similarity index 65%
rename from kernel/install/gnome/bbed.desktop.in
rename to kernel/install/gnome/bbStudio.desktop.in
index 40f1ce96201f272b9e00bdc2a3b3cdc2c0dd0193..7bb960aebf20f19390cc1cb64e69c3536712e3a0 100644 (file)
@@ -1,11 +1,11 @@
 [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
index 1e280d169981e9ff8a8b3473b4031e633299c201..5a428a61ac0c43bb2651369cf57b0ef8de65e408 100755 (executable)
@@ -1,10 +1,10 @@
 #!/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)
@@ -21,13 +21,13 @@ rm bbtk_install_gnome_tmp
 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/
index 9fa297fef97255169453154daae0800cf02c359c..f8d71a28d9f0629e8b6fb8c89160e46c081d2195 100644 (file)
@@ -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;
     /*
index 8c28996c4e506da8fed7678ba3ca116c8d047288..bc21a292287b96f3cdc776d07d76c3e4dcb812c4 100644 (file)
@@ -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 << "<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"; 
index f908f65155cf2c42396d08a64f2b98edd2a265b6..7d2eb54530322538df4253fdf6bb53afde5bca77 100644 (file)
@@ -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 <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";
index 669d9ac2cb0eb4bdff773e38de94ec95deb72e56..9a6d3a7e1dde45c49400fbcdf4afee813e3cb517 100644 (file)
@@ -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);
   }