You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(102) |
Dec
(255) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(38) |
Feb
(16) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mik...@us...> - 2003-12-30 10:45:14
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src In directory sc8-pr-cvs1:/tmp/cvs-serv7723/src Modified Files: Main.cpp Log Message: 30/12/2003 Mikael Barbeaux * Implemented a Http processor thread object. * Implemented a Http connections manager object. * Modified configure script for pthread library. Index: Main.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/Main.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Main.cpp 26 Dec 2003 22:56:43 -0000 1.7 +++ Main.cpp 30 Dec 2003 10:45:11 -0000 1.8 @@ -22,6 +22,7 @@ #include "test/TestSemaphore.h" #include "test/TestSocket.h" #include "test/TestHttpSocket.h" +#include "test/TestHttpManager.h" #include <iostream> #include <string> using namespace std; @@ -30,12 +31,23 @@ * Main program. */ int main() { + #ifdef _WIN32_ + // Init WINSOCK + WORD winsockminversion = MAKEWORD(2,0); + WSADATA wsaData; + int WSockStatus = WSAStartup(winsockminversion, &wsaData); + if(WSockStatus != 0) { + cout << "ERROR_WINSOCK" << std::endl; + return -1; + } + #endif + cout << "Choose a test to run : " << endl; cout << " 1. Exceptions test" << endl; cout << " 2. Threads test" << endl; cout << " 3. Semaphores test" << endl; cout << " 4. Generic Sockets test" << endl; - cout << " 5. HTTP sockets test" << endl; + cout << " 5. HTTP Manager test" << endl; cout << "Enter your choice : "; bool cont = true; @@ -62,33 +74,13 @@ cont = false; } else if(command == "4") { - #ifdef _WIN32_ - // Init WINSOCK - WORD winsockminversion = MAKEWORD(2,0); - WSADATA wsaData; - int WSockStatus = WSAStartup(winsockminversion, &wsaData); - if(WSockStatus != 0) { - cout << "ERROR_WINSOCK" << std::endl; - return -1; - } - #endif TestSocket test_sock; test_sock.test(); cont = false; } else if(command == "5") { - #ifdef _WIN32_ - // Init WINSOCK - WORD winsockminversion = MAKEWORD(2,0); - WSADATA wsaData; - int WSockStatus = WSAStartup(winsockminversion, &wsaData); - if(WSockStatus != 0) { - cout << "ERROR_WINSOCK" << std::endl; - return -1; - } - #endif - TestHttpSocket test_http; - test_http.test(); + TestHttpManager test_httpman; + test_httpman.test(); cont = false; } else cout << "Invalid choice... Enter your choice : "; |
From: <mik...@us...> - 2003-12-30 10:45:14
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/test In directory sc8-pr-cvs1:/tmp/cvs-serv7723/src/test Modified Files: TestHttpSocket.cpp Added Files: TestHttpManager.cpp TestHttpManager.h Log Message: 30/12/2003 Mikael Barbeaux * Implemented a Http processor thread object. * Implemented a Http connections manager object. * Modified configure script for pthread library. --- NEW FILE: TestHttpManager.cpp --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * 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 */ #include "TestHttpManager.h" #include "../exceptions/Exception.h" #include "../server/http/HttpServerSocket.h" #include "../server/http/manager/HttpManager.h" #include "../server/http/manager/HttpProcessor.h" #include "../thread/Thread.h" #include <iostream> using namespace std; #include <stdio.h> /** * Constructor for TestHttpManager. */ TestHttpManager::TestHttpManager() : TestHandler() { } /** * Destructor for TestHttpManager. */ TestHttpManager::~TestHttpManager() { } /** * Runs the tester */ void TestHttpManager::test() { /** This test tries to launch the http connections manager * and goes on working. */ cout << endl; cout << "ShareDaemon Web Interface - Test" << endl << endl; cout << "Test for Http connections manager... " << endl; cout << "The tester will launch the HttpManager and a http" << endl; cout << "server listening connections on port 4589. The server" << endl; cout << "will send connections to the manager which will process" << endl; cout << "them thanks to the Http processors objects." << endl; cout << "Press enter to continue" << endl; getchar(); cout << endl << endl; try { cout << "Creates a http server socket on port 4589..." << endl; HttpServerSocket *server = new HttpServerSocket(4589); cout << "Creates the Http manager" << endl; HttpManager *manager = HttpManager::getInstance(); cout << "Creates 5 Http processors" << endl; HttpProcessor *p1 = new HttpProcessor(1); HttpProcessor *p2 = new HttpProcessor(2); HttpProcessor *p3 = new HttpProcessor(3); HttpProcessor *p4 = new HttpProcessor(4); HttpProcessor *p5 = new HttpProcessor(5); cout << "Starts the processors" << endl; p1->start(); p2->start(); p3->start(); p4->start(); p5->start(); cout << "Starts the server for 20 seconds" << endl; server->start(); for(int i=0;i<20;i++) { cout << "Waited " << i << " seconds..." <<endl; Thread::sleep(1); } cout << "Stop the server" << endl; server->stop(); cout << "Stop the processors" << endl; p1->cancel(); p2->cancel(); p3->cancel(); p4->cancel(); p5->cancel(); manager->release(); cout << "Delete processors" << endl; delete p1; delete p2; delete p3; delete p4; delete p5; cout << "Delete the manager" << endl; delete manager; cout << "Delete the server" << endl; delete server; } catch(Exception& e) { // display the exception message cout << e.getMessage() << endl; } cout << "Could you connect to the socket and did you see the response ?" << endl; cout << " If no => VERY BAD :(" << endl; cout << " If yes => Test worked !! :D" << endl << endl; cout << "Press enter to continue" << endl; getchar(); } --- NEW FILE: TestHttpManager.h --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * 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 */ #ifndef _TEST_HTTP_MANAGER_H_ #define _TEST_HTTP_MANAGER_H_ #include "TestHandler.h" /** * Defines a test class for HttpManager. */ class TestHttpManager : public TestHandler { public: /** * Creates a test for http manager. */ TestHttpManager(); /** * Destructor for TestHttpManager */ ~TestHttpManager(); /** * Runs the tester. */ virtual void test(); }; #endif Index: TestHttpSocket.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/test/TestHttpSocket.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TestHttpSocket.cpp 27 Dec 2003 11:42:39 -0000 1.2 +++ TestHttpSocket.cpp 30 Dec 2003 10:45:10 -0000 1.3 @@ -57,7 +57,7 @@ try { cout << "Creates a http server on port 4589..." << endl; HttpServerSocket *server = new HttpServerSocket(4589); - cout << "Starts the server for 30 seconds..." << endl; + cout << "Starts the server for 20 seconds..." << endl; server->start(); for(int i=0;i<20;i++) { cout << "Waited " << i << " seconds..." <<endl; |
From: <mik...@us...> - 2003-12-30 10:45:13
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/http In directory sc8-pr-cvs1:/tmp/cvs-serv7723/src/server/http Modified Files: HttpServerSocket.cpp Log Message: 30/12/2003 Mikael Barbeaux * Implemented a Http processor thread object. * Implemented a Http connections manager object. * Modified configure script for pthread library. Index: HttpServerSocket.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/http/HttpServerSocket.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- HttpServerSocket.cpp 27 Dec 2003 11:56:06 -0000 1.6 +++ HttpServerSocket.cpp 30 Dec 2003 10:45:09 -0000 1.7 @@ -18,6 +18,7 @@ */ #include "HttpServerSocket.h" +#include "manager/HttpManager.h" #include "TextWriter.h" #include <iostream> using namespace std; @@ -76,25 +77,7 @@ continue; } // process the connection - //theManager->addConnection(client); - - cout << "Socket accepted !" << endl; - HttpRequest request; - cout << "Receiving HTTP request..." << endl; - client->receiveHttpRequest(request); - cout << "Reveiced mesage : " << endl; - cout << request.toString() << endl; - cout << "Send response" << endl; - TextWriter *writer = new TextWriter; - *writer << "<html><body>Request received !</body></html>"; - writer->close(); - HttpResponse response(writer); - response.setContentType("text/html"); - client->sendHttpResponse(response); - cout << "Closing socket..." << endl; - client->close(); - delete client; - + theManager->addConnection(client); } catch(Exception& e) { cout << e.getMessage() << endl; |
From: <ma...@us...> - 2003-12-30 10:28:42
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv5031 Modified Files: MainDlg.cpp Log Message: Detached frames also now have icons. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- MainDlg.cpp 30 Dec 2003 10:15:46 -0000 1.54 +++ MainDlg.cpp 30 Dec 2003 10:28:39 -0000 1.55 @@ -49,7 +49,7 @@ /****************************************************************** MyToolBar */ /* Just a dummy constructor for MyToolBar class - nothing to be done here. */ -/*****************************************************************************/ +/******************************************************************************/ MyToolBar::MyToolBar( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style @@ -79,6 +79,10 @@ const wxPoint &position, const wxSize& size, long style, wxLocale &l, Page *content ) : wxFrame( parent, id, title, position, size, style ), m_locale(l) { + wxIcon tmp; + tmp.CopyFromBitmap(img->GetImage(wxT("mule"))); + SetIcon(tmp); + cnt = content; wxFlexGridSizer *s = new wxFlexGridSizer(1); s->AddGrowableCol(0); |
From: <ma...@us...> - 2003-12-30 10:15:49
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv2848 Modified Files: MainDlg.cpp Log Message: Faster shutdown Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- MainDlg.cpp 30 Dec 2003 10:12:59 -0000 1.53 +++ MainDlg.cpp 30 Dec 2003 10:15:46 -0000 1.54 @@ -493,8 +493,6 @@ /* corresponding value from config object). If so, display a messagebox, */ /* and abort shutdown if No is clicked. Otherwise, if prompt_exit is false */ /* or Yes is clicked in confirmation dialog, hide and destroy the frame. */ -/* Hiding is needed to make shutdown process seem faster and avoid any */ -/* delays Destroy() call produces. */ /******************************************************************************/ void CMainDlg::OnCloseWindow(wxCloseEvent &event){ bool prompt_exit; @@ -510,9 +508,7 @@ return; } } - - Hide(); - Destroy(); + event.Skip(); } /********************************************************* ConnectToAnyServer */ |
From: <ma...@us...> - 2003-12-30 10:13:05
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv2258 Modified Files: MainDlg.cpp Log Message: Typo fix Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- MainDlg.cpp 30 Dec 2003 09:09:30 -0000 1.52 +++ MainDlg.cpp 30 Dec 2003 10:12:59 -0000 1.53 @@ -395,7 +395,7 @@ ); } /* On wxGTK, we can use custom control in both toolbar positions */ -#elif defined(__WXGTK__) { +#elif defined(__WXGTK__) names.Add(_("Connect")); names.Add(_("Log")); ids[1] = ID_BTN_CONNECT; |
From: <mik...@us...> - 2003-12-30 09:19:33
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/http/manager In directory sc8-pr-cvs1:/tmp/cvs-serv27523/src/server/http/manager Added Files: HttpManager.h HttpManager.cpp Log Message: 30/12/2003 Mikael Barbeaux * Implemented a Http connection manager. --- NEW FILE: HttpManager.h --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * 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 */ #ifndef _HTTP_MANAGER_H_ #define _HTTP_MANAGER_H_ #include "../HttpSocket.h" #include "../../../thread/Semaphore.h" #include "../../../thread/Mutex.h" #include <deque> using namespace std; /** * Defines a manager for HTTP connections. * Formely, it's a thread pool where connections * are stocked and treated. */ class HttpManager{ private: // pool of connections deque<HttpSocket*> connections; // unique instance of HttpManager static HttpManager *instance; /* semaphore for signaling processors than a connection is waiting to be processed */ Semaphore *conn_notEmpty; /* mutex for accessing datas */ Mutex mutex; protected: /** * Creates a HttpManager object. * As this class implements the Singleton * design pattern, the constructor is protected. */ HttpManager(); public: /** * Destructor for HttpManager. */ ~HttpManager(); /** * Add a connection into the manager * * @param connection */ void addConnection(HttpSocket *connection); /** * Returns the next connection to be processed. * * @return HttpSocket* */ HttpSocket *getNextConnection(); /** * Returns the unique instance of HttpManager. * * @return HttpManager* */ static HttpManager *getInstance(); }; #endif --- NEW FILE: HttpManager.cpp --- /* * This file is part of webInterface. * Copyright (C) 2003 Mikael Barbeaux <mik...@us...> * * 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 */ #include "HttpManager.h" HttpManager *HttpManager::instance = 0; /** * Constructor for HttpManager. * Inits the semaphore. */ HttpManager::HttpManager() { conn_notEmpty = new Semaphore(0); } /** * HttpManager destructor. * Deletes the semaphore. */ HttpManager::~HttpManager() { delete conn_notEmpty; } /** * Returns the unique instance of HttpManager */ HttpManager *HttpManager::getInstance() { // init instance if not yet done if(instance == 0) instance = new HttpManager; return instance; } /** * Add a connection into the manager */ void HttpManager::addConnection(HttpSocket *connection) { // add the connection into the pool mutex.lock(); connections.push_back(connection); mutex.unlock(); // Signals the processors that a connection is pending conn_notEmpty->post(); } /** * Returns the next connection to be processed. */ HttpSocket *HttpManager::getNextConnection() { HttpSocket *socket = 0; mutex.lock(); if(connections.size() > 0) { socket = connections.front(); connections.pop_front(); } mutex.unlock(); return socket; } |
From: <mik...@us...> - 2003-12-30 09:19:32
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv27523 Modified Files: configure ChangeLog INSTALL Log Message: 30/12/2003 Mikael Barbeaux * Implemented a Http connection manager. Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/configure,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure 29 Dec 2003 17:43:19 -0000 1.4 +++ configure 30 Dec 2003 09:19:29 -0000 1.5 @@ -31,8 +31,15 @@ check_command g++ COMP_EXE=$COMM - check_command make - MAKE_EXE=$COMM + + if test $SYSTEM = "FreeBSD" + then + check_command gmake + MAKE_EXE=$COMM + else + check_command make + MAKE_EXE=$COMM + fi check_command ar AR_EXE=$COMM @@ -153,7 +160,7 @@ else echo "CCFLAGS =" >> Makefile fi - echo "" + echo "CCFLAGS += -O3 -fexpensive-optimizations" >> Makefile echo "all : clean \$(BIN) strip" >> Makefile @@ -268,10 +275,6 @@ echo "Available options for configure :" echo " --help" echo " displays this help" - echo " --optimize" - echo " enable optimization flags" - echo " --debug" - echo " enable debugging" } @@ -293,7 +296,7 @@ THREADS_OBJS=`find . -name '*.cpp' | grep thread | sed -e 's/.cpp/.o \\\/'` EXC_OBJ=`find . -name '*.cpp' | grep /Exception.cpp | sed -e 's/.cpp/.o \\\/'` THREAD_EXCP_OBJ=`find . -name '*.cpp' | grep /ThreadException.cpp | sed -e 's/.cpp/.o \\\/'` -OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/ThreadException.cpp/d' | sed '/\/thread/d' | sed -e 's/.cpp/.o \\\/'` +OTHER_OBJS=`find . -name '*.cpp' | sed '/\/ThreadException.cpp/d' | sed '/\/thread/d' | sed -e 's/.cpp/.o \\\/'` #### @@ -303,7 +306,8 @@ echo "ShareDaemon Web Interface - configure script" echo "Written by MikaelB" CONF_OPTIONS=$1 - +OS=`uname -n` +SYSTEM=`uname -s` if test -n "$CONF_OPTIONS" -a "$CONF_OPTIONS" = "--help" then @@ -312,8 +316,6 @@ check_config; fi -OS=`uname -n` -SYSTEM=`uname -s` echo "" echo "Check system : $OS - $SYSTEM" Index: ChangeLog =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ChangeLog 29 Dec 2003 16:33:44 -0000 1.18 +++ ChangeLog 30 Dec 2003 09:19:29 -0000 1.19 @@ -23,6 +23,9 @@ ----------------------------------------------------------- +30/12/2003 Mikael Barbeaux + * Implemented a Http connection manager. + 29/12/2003 Mikael Barbeaux * Fixed a little bug into configure script. * Wrote a configure script that auto generates a Makefile Index: INSTALL =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/INSTALL,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- INSTALL 29 Dec 2003 16:05:37 -0000 1.3 +++ INSTALL 30 Dec 2003 09:19:29 -0000 1.4 @@ -13,6 +13,7 @@ CVS ). Then, go into the directory where your downloaded ( and unzipped ) the sources and type the following : + $> chmod 755 configure $> ./configure $> make |
From: <mik...@us...> - 2003-12-30 09:19:25
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/http/manager In directory sc8-pr-cvs1:/tmp/cvs-serv27501/src/server/http/manager Log Message: Directory /cvsroot/sharedaemon/sharedaemon-ui-web/src/server/http/manager added to the repository |
From: <ma...@us...> - 2003-12-30 09:09:33
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv26176 Modified Files: MainDlg.cpp MainDlg.h Log Message: Moved actual toolbar button creation into GenerateToolBarButtons method and using somewhat more readable #ifdefing now. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- MainDlg.cpp 30 Dec 2003 08:20:53 -0000 1.51 +++ MainDlg.cpp 30 Dec 2003 09:09:30 -0000 1.52 @@ -295,8 +295,8 @@ /* to restart the toolbar. Settings are read from m_config object, new */ /* MyToolBar object is created (note that we don't use wxToolBar but our */ /* derived class instead - needed to catch some events - see MyToolBar class).*/ -/* Continueing, after adding some standard buttons, we iterate on the `pages` */ -/* list and add all pages found there. */ +/* The actual buttons are added in GenerateMyToolBar method to keep this */ +/* function relativly clean. */ /* @gen_images If true, also (re)generates images */ /******************************************************************************/ void CMainDlg::CreateMyToolBar(bool gen_images) { @@ -305,7 +305,6 @@ unsigned int i; /* Loop counter */ wxArrayString names; /* Names for multibutton controls */ wxArrayString images; /* Images for multibutton controls */ -int ids[2]; /* Identifiers for multibutton controls */ MyToolBar *toolbar = (MyToolBar*)GetToolBar(); delete toolbar; @@ -344,16 +343,39 @@ ); tb->SetMargins(2, 2); + /* There we create actual buttons */ + GenerateToolBarButtons(tb, gen_images, tool_align); + + tb->Realize(); + SetToolBar(tb); + tb->Refresh(); /* Fix for wxMac issues */ + Layout(); /* Needed after deleting/creation */ + UpdateToolBar(); +} + +/***************************************************** GenerateToolBarButtons */ +/* Here we create the actual buttons. There's a lot of #ifdefing going around */ +/* here because wxControl objects in toolbar aren't supported on most */ +/* platforms. Only places where we can use our MMultiButton control is */ +/* horizontal toolbar on wxMSW, and horizontal/vertical toolbars on wxGTK. */ +/* @tb Toolbar to be created buttons on */ +/* @gen_images If true, images are generated also. */ +/* @tool_align Alignment of the toolbar in question */ +/******************************************************************************/ +void CMainDlg::GenerateToolBarButtons( + MyToolBar *tb, bool gen_images, int tool_align +) { +wxArrayString names, images; /* Names/images for multibuttons */ +int ids[2]; /* Identifiers for multibutton controls */ +unsigned int i; /* Loop counter */ + if (gen_images) { img->MakeToolImage(_("Connect"), wxT("btn_connect")); } -/* Neither the generic nor Motif native toolbars really support this :( */ -#if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && \ - !defined(__WXX11__) && !defined(__WXMAC__) - #ifdef __WXMSW__ /* Doesn't work in vertical MSW toolbar either :(((( */ +/* On wxMSW, only use custom control in horizontal toolbar. */ +#ifdef __WXMSW__ if (tool_align == wxTB_HORIZONTAL) { - #endif names.Add(_("Connect")); names.Add(_("Log")); ids[1] = ID_BTN_CONNECT; @@ -363,12 +385,7 @@ tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); images.Clear(); names.Clear(); - #ifdef __WXMSW__ - } else - #endif -#endif -#if !defined(__WXGTK__) - { + } else { tb->AddTool( ID_BTN_CONNECT, _("Connect"), img->GetImage(wxT("btn_connect")), @@ -377,6 +394,26 @@ _("Connect to random server") ); } +/* On wxGTK, we can use custom control in both toolbar positions */ +#elif defined(__WXGTK__) { + names.Add(_("Connect")); + names.Add(_("Log")); + ids[1] = ID_BTN_CONNECT; + ids[1] = ID_BTN_LOG; + images.Add(wxT("connection")); + images.Add(wxT("log")); + tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); + images.Clear(); + names.Clear(); +/* Anywhere else, custom controls in toolbar aren't supported at all */ +#else + tb->AddTool( + ID_BTN_CONNECT, _("Connect"), + img->GetImage(wxT("btn_connect")), + img->GetImage(wxT("btn_connect")), + wxITEM_NORMAL, _("Connect to random server"), + _("Connect to random server") + ); #endif /* Go through list of our pages and add all of them */ @@ -406,12 +443,9 @@ _("Options"), wxT("btn_guisettings") ); } -/* Neither the generic nor Motif native toolbars really support this :( */ -#if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && \ - !defined(__WXX11__) && !defined(__WXMAC__) - #ifdef __WXMSW__ /* Doesn't work in vertical MSW toolbar either :(((( */ +/* On wxMSW, only use custom control in horizontal toolbar. */ +#ifdef __WXMSW__ if (tool_align == wxTB_HORIZONTAL) { - #endif names.Add(_("Options")); names.Add(_("Help")); ids[0] = ID_BTN_GUISETTINGS; @@ -421,12 +455,7 @@ tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); images.Clear(); names.Clear(); - #ifdef __WXMSW__ - } else - #endif -#endif -#if !defined(__WXGTK__) - { + } else { tb->AddTool( ID_BTN_GUISETTINGS, _("Options"), img->GetImage(wxT("btn_guisettings")), @@ -435,13 +464,27 @@ wxT("Change GUI Settings") ); } +/* On wxGTK, we can use custom control in both toolbar positions */ +#elif defined(__WXGTK__) + names.Add(_("Options")); + names.Add(_("Help")); + ids[0] = ID_BTN_GUISETTINGS; + ids[1] = ID_BTN_HELP; + images.Add(wxT("options")); + images.Add(wxT("help")); + tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); + images.Clear(); + names.Clear(); +/* Anywhere else, custom controls in toolbar aren't supported at all */ +#else + tb->AddTool( + ID_BTN_GUISETTINGS, _("Options"), + img->GetImage(wxT("btn_guisettings")), + img->GetImage(wxT("btn_guisettings")), + wxITEM_NORMAL, wxT("Change GUI Settings"), + wxT("Change GUI Settings") + ); #endif - - tb->Realize(); - SetToolBar(tb); - tb->Refresh(); /* Fix for wxMac issues */ - Layout(); /* Needed after deleting/creation */ - UpdateToolBar(); } /************************************************************** OnCloseWindow */ Index: MainDlg.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- MainDlg.h 27 Dec 2003 12:38:55 -0000 1.18 +++ MainDlg.h 30 Dec 2003 09:09:30 -0000 1.19 @@ -180,6 +180,9 @@ ); /* `remove` is true */ void DetachCurPage(); /* Detaches current page into new frame */ void ShowToolPopupMenu(); /* Displays toolbar popup menu */ + void GenerateToolBarButtons( /* There the actual buttons are created */ + MyToolBar *tb, bool gen_images, int tool_align + ); /* Getters - small methods for retreiving various kinds of data */ Page* GetCurPage() { return cur_page;} /* Returns current active page */ |
From: <ma...@us...> - 2003-12-30 08:20:56
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv20018 Modified Files: MainDlg.cpp Log Message: Hm, this time it works in wxMSW... Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- MainDlg.cpp 30 Dec 2003 08:18:15 -0000 1.50 +++ MainDlg.cpp 30 Dec 2003 08:20:53 -0000 1.51 @@ -366,7 +366,8 @@ #ifdef __WXMSW__ } else #endif -#elif !defined(__WXGTK__) +#endif +#if !defined(__WXGTK__) { tb->AddTool( ID_BTN_CONNECT, _("Connect"), @@ -423,7 +424,8 @@ #ifdef __WXMSW__ } else #endif -#elif !defined(__WXGTK__) +#endif +#if !defined(__WXGTK__) { tb->AddTool( ID_BTN_GUISETTINGS, _("Options"), |
From: <ma...@us...> - 2003-12-30 08:18:19
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv19614 Modified Files: MainDlg.cpp Log Message: Gotta be the ugliest #ifdefing I have ever done, but - now toolbar controls work correctly in wxGTK Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- MainDlg.cpp 30 Dec 2003 07:51:23 -0000 1.49 +++ MainDlg.cpp 30 Dec 2003 08:18:15 -0000 1.50 @@ -351,8 +351,9 @@ /* Neither the generic nor Motif native toolbars really support this :( */ #if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && \ !defined(__WXX11__) && !defined(__WXMAC__) - /* Doesn't work in vertical toolbar either :(((( */ + #ifdef __WXMSW__ /* Doesn't work in vertical MSW toolbar either :(((( */ if (tool_align == wxTB_HORIZONTAL) { + #endif names.Add(_("Connect")); names.Add(_("Log")); ids[1] = ID_BTN_CONNECT; @@ -362,17 +363,20 @@ tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); images.Clear(); names.Clear(); - } else -#endif + #ifdef __WXMSW__ + } else + #endif +#elif !defined(__WXGTK__) { tb->AddTool( - ID_BTN_CONNECT, _("Connect"), + ID_BTN_CONNECT, _("Connect"), img->GetImage(wxT("btn_connect")), img->GetImage(wxT("btn_connect")), wxITEM_NORMAL, _("Connect to random server"), _("Connect to random server") ); } +#endif /* Go through list of our pages and add all of them */ for (i=0;i<pages.GetCount();i++) { @@ -404,8 +408,9 @@ /* Neither the generic nor Motif native toolbars really support this :( */ #if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && \ !defined(__WXX11__) && !defined(__WXMAC__) - /* Doesn't work in vertical toolbar either :(((( */ + #ifdef __WXMSW__ /* Doesn't work in vertical MSW toolbar either :(((( */ if (tool_align == wxTB_HORIZONTAL) { + #endif names.Add(_("Options")); names.Add(_("Help")); ids[0] = ID_BTN_GUISETTINGS; @@ -415,17 +420,20 @@ tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); images.Clear(); names.Clear(); - } else -#endif + #ifdef __WXMSW__ + } else + #endif +#elif !defined(__WXGTK__) { tb->AddTool( - ID_BTN_GUISETTINGS, _("Options"), + ID_BTN_GUISETTINGS, _("Options"), img->GetImage(wxT("btn_guisettings")), img->GetImage(wxT("btn_guisettings")), wxITEM_NORMAL, wxT("Change GUI Settings"), wxT("Change GUI Settings") ); } +#endif tb->Realize(); SetToolBar(tb); |
From: <ma...@us...> - 2003-12-30 07:51:26
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv15837 Modified Files: MainDlg.cpp Log Message: Well, wxMac, wxMotif, wxX11 and generic native toolbars dont support controls. Furthermore, MSW vertical toolbar doesnt support it either. Summary: Use our cool custom controls in toolbar only in wxMSW horizontal toolbar, and wxGTK hor/vert toolbar. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- MainDlg.cpp 29 Dec 2003 11:24:30 -0000 1.48 +++ MainDlg.cpp 30 Dec 2003 07:51:23 -0000 1.49 @@ -327,14 +327,16 @@ ); if (start_up || gen_images) { - wxArrayString names; for (i=0;i<pages.GetCount();i++) { if (pages.IsEmpty()) { break; } names.Add(pages.Item(i)->GetKeyString()); } + names.Add(_("Connect")); + names.Add(_("Options")); img->CalcToolBitmapSize(names); + names.Clear(); } tb->SetToolBitmapSize( @@ -342,16 +344,37 @@ ); tb->SetMargins(2, 2); - names.Add(_("Connect")); - names.Add(_("Log")); - ids[1] = ID_BTN_CONNECT; - ids[1] = ID_BTN_LOG; - images.Add(wxT("connection")); - images.Add(wxT("log")); - tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); - images.Clear(); - names.Clear(); + if (gen_images) { + img->MakeToolImage(_("Connect"), wxT("btn_connect")); + } + +/* Neither the generic nor Motif native toolbars really support this :( */ +#if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && \ + !defined(__WXX11__) && !defined(__WXMAC__) + /* Doesn't work in vertical toolbar either :(((( */ + if (tool_align == wxTB_HORIZONTAL) { + names.Add(_("Connect")); + names.Add(_("Log")); + ids[1] = ID_BTN_CONNECT; + ids[1] = ID_BTN_LOG; + images.Add(wxT("connection")); + images.Add(wxT("log")); + tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); + images.Clear(); + names.Clear(); + } else +#endif + { + tb->AddTool( + ID_BTN_CONNECT, _("Connect"), + img->GetImage(wxT("btn_connect")), + img->GetImage(wxT("btn_connect")), + wxITEM_NORMAL, _("Connect to random server"), + _("Connect to random server") + ); + } + /* Go through list of our pages and add all of them */ for (i=0;i<pages.GetCount();i++) { if (pages.IsEmpty()){ break; @@ -373,15 +396,36 @@ ); } - names.Add(_("Options")); - names.Add(_("Help")); - ids[0] = ID_BTN_GUISETTINGS; - ids[1] = ID_BTN_HELP; - images.Add(wxT("options")); - images.Add(wxT("help")); - tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); - images.Clear(); - names.Clear(); + if (gen_images) { + img->MakeToolImage( + _("Options"), wxT("btn_guisettings") + ); + } +/* Neither the generic nor Motif native toolbars really support this :( */ +#if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && \ + !defined(__WXX11__) && !defined(__WXMAC__) + /* Doesn't work in vertical toolbar either :(((( */ + if (tool_align == wxTB_HORIZONTAL) { + names.Add(_("Options")); + names.Add(_("Help")); + ids[0] = ID_BTN_GUISETTINGS; + ids[1] = ID_BTN_HELP; + images.Add(wxT("options")); + images.Add(wxT("help")); + tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); + images.Clear(); + names.Clear(); + } else +#endif + { + tb->AddTool( + ID_BTN_GUISETTINGS, _("Options"), + img->GetImage(wxT("btn_guisettings")), + img->GetImage(wxT("btn_guisettings")), + wxITEM_NORMAL, wxT("Change GUI Settings"), + wxT("Change GUI Settings") + ); + } tb->Realize(); SetToolBar(tb); |
From: <ma...@us...> - 2003-12-30 05:43:55
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv31757/src Modified Files: SysTray.h Log Message: Fixed BSD detection Index: SysTray.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SysTray.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- SysTray.h 28 Dec 2003 05:34:17 -0000 1.7 +++ SysTray.h 30 Dec 2003 05:43:52 -0000 1.8 @@ -65,11 +65,13 @@ //window manager detection #include <X11/Xatom.h> //ip detection -#include <sys/ioctl.h> -#include <net/if.h> -#include <arpa/inet.h> -#include <stdlib.h> -#include <stdio.h> +#if !defined (__BSD__) && !defined (__MAC__) + #include <sys/ioctl.h> + #include <net/if.h> + #include <arpa/inet.h> + #include <stdlib.h> + #include <stdio.h> +#endif //GTK Tray personalized from Tiku's one #include "TrayCoreEngine.h" //Value definition |
From: <ma...@us...> - 2003-12-30 05:43:55
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv31757 Modified Files: configure Log Message: Fixed BSD detection Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/configure,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- configure 30 Dec 2003 05:35:05 -0000 1.16 +++ configure 30 Dec 2003 05:43:52 -0000 1.17 @@ -149,9 +149,7 @@ shift; done; - if test $system = "FreeBSD"; then colours=0; fi; - if test $system = "NetBSD"; then colours=0; fi; - if test $system = "OpenBSD"; then colours=0; fi; + if test $system = "BSD"; then colours=0; fi; if test $system = "Cygwin"; then colours=0; fi; echo -e "checking for --disable-colours\\t\\t\\t\\c"; @@ -451,9 +449,7 @@ fi; fi; - if test $system = "FreeBSD"; then cppflags="$cppflags -D__BSD__"; fi; - if test $system = "NetBSD"; then cppflags="$cppflags -D__BSD__"; fi; - if test $system = "OpenBSD"; then cppflags="$cppflags -D__BSD__"; fi; + if test $system = "BSD"; then cppflags="$cppflags -D__BSD__"; fi; if test $show_flags = 1; then print_cpp_flags=" with flags: `$wxconfig --cxxflags` $cppflags $include"; |
From: <ma...@us...> - 2003-12-30 05:35:14
|
Update of /cvsroot/sharedaemon/ui-wx In directory sc8-pr-cvs1:/tmp/cvs-serv30631 Modified Files: configure Log Message: Now detects environment. Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/configure,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- configure 26 Dec 2003 14:25:28 -0000 1.15 +++ configure 30 Dec 2003 05:35:05 -0000 1.16 @@ -19,6 +19,53 @@ ################################################################################ ## +# Checks for environment +# +check_env() { + echo -e "checking environment...\\t\\t\\t\\t\\c"; + env=`uname -s`; + case $env in + MINGW32_NT-5.1) + system=Mingw32; + ;; + MINGW32_NT-5.2) + system=Mingw32; + ;; + MINGW32_98-4.10) + system=Mingw32; + ;; + CYGWIN_NT-5.1) + system=Cygwin; + ;; + CYGWIN_NT-5.2) + system=Cygwin; + ;; + CYGWIN_98-4.10) + system=Cygwin; + ;; + Linux) + system=Linux; + ;; + FreeBSD) + system=BSD; + ;; + NetBSD) + system=BSD; + ;; + OpenBSD) + system=BSD; + ;; + SunOS) + system=SunOS; + ;; + *) + system=Unknown; + ;; + esac; + echo $system; +} + +## # Parses command-line options and sets variables as needed. # parse_cmdline() { @@ -102,6 +149,11 @@ shift; done; + if test $system = "FreeBSD"; then colours=0; fi; + if test $system = "NetBSD"; then colours=0; fi; + if test $system = "OpenBSD"; then colours=0; fi; + if test $system = "Cygwin"; then colours=0; fi; + echo -e "checking for --disable-colours\\t\\t\\t\\c"; if test $colours = 1; then colour_default="\33[0;2m" @@ -399,6 +451,10 @@ fi; fi; + if test $system = "FreeBSD"; then cppflags="$cppflags -D__BSD__"; fi; + if test $system = "NetBSD"; then cppflags="$cppflags -D__BSD__"; fi; + if test $system = "OpenBSD"; then cppflags="$cppflags -D__BSD__"; fi; + if test $show_flags = 1; then print_cpp_flags=" with flags: `$wxconfig --cxxflags` $cppflags $include"; print_link_flags=" with flags: $linkflags"; @@ -462,6 +518,7 @@ ## # Main script execution part. # +check_env; parse_cmdline $@; check_wxconfig; check_wxversion; |
From: <ma...@us...> - 2003-12-29 19:02:18
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv19831 Modified Files: ServerWnd.cpp Log Message: Fixed GTK2 segfault on startup Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- ServerWnd.cpp 29 Dec 2003 09:52:38 -0000 1.56 +++ ServerWnd.cpp 29 Dec 2003 19:02:13 -0000 1.57 @@ -637,7 +637,7 @@ /* thus could get really cpu-hungry if there are large amount of lines here. */ /******************************************************************************/ void CServerWnd::OnAddLogLine(wxCommandEvent &event) { -#ifndef __WXMSW__ +#if defined(__WXGTK__) && !defined(__GTK2__) GetLog()->ShowPosition(log_line_count); log_line_count++; #endif |
From: <mik...@us...> - 2003-12-29 17:43:24
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv4357 Modified Files: configure Log Message: 29/12/2003 Mikael Barbeaux * Fixed configure script bugs under FreeBSD Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/configure,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- configure 29 Dec 2003 16:39:01 -0000 1.3 +++ configure 29 Dec 2003 17:43:19 -0000 1.4 @@ -31,7 +31,7 @@ check_command g++ COMP_EXE=$COMM - check_command make + check_command make MAKE_EXE=$COMM check_command ar @@ -139,6 +139,9 @@ if test $OS_TEST = "MINGW" then echo "LIBS = -L. -lws2_32 -lsd_threads" >> Makefile + elif test $SYSTEM = "FreeBSD" + then + echo "LIBS = -L. -lsd_threads -pthread" >> Makefile else echo "LIBS = -L. -lpthread -lsd_threads" >> Makefile fi @@ -318,6 +321,11 @@ build_Makefile; echo "" echo "Configure script successfully ended." -echo "Now, type \"make\" for compiling the software." +if test $SYSTEM = "FreeBSD" +then + echo "Now, type \"gmake\" for compiling the software." +else + echo "Now, type \"make\" for compiling the software." +fi # End |
From: <mik...@us...> - 2003-12-29 16:39:04
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv24526 Modified Files: configure Log Message: 29/12/2003 Mikael Barbeaux * configure - compatible with Linux format Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/configure,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configure 29 Dec 2003 16:33:44 -0000 1.2 +++ configure 29 Dec 2003 16:39:01 -0000 1.3 @@ -1,323 +1,323 @@ -#!/bin/sh -# Configure script for ShareDaemon Web Interface - -# -# This file is part of webInterface. -# Copyright (C) 2003 Mikael Barbeaux <mik...@us...> -# -# 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 -# - - - -#### -# Check configuration -#### -check_config() { - echo "" - - check_command g++ - COMP_EXE=$COMM - - check_command make - MAKE_EXE=$COMM - - check_command ar - AR_EXE=$COMM - - check_command rm - RM_EXE=$COMM - - check_command strip - STRIP_EXE=$COMM - - check_command uname - UNAME_EXE=$COMM - - check_lib stdc++ libstdc++.a - - OS_TEST=`uname -s | cut -c1-5` - if test $OS_TEST = "MINGW" - then - check_lib winsock libws2_32.a - fi -} - - - -#### -# Check for a command -#### -check_command() { - COMM=`which $1` - if test -z ${COMM} - then - echo "Checking for $1 not found" - help_comp; - else - echo "Checking for $1 ${COMM}" - fi -} - - - -#### -# Check for library -#### -check_lib() { - LIBNAME=$1 - LIB=`$COMP_EXE -print-file-name=$2` - if test $LIB = $LIBNAME - then - echo "Checking for $LIBNAME not found" - help_comp; - else - echo "Checking for $LIBNAME found" - fi -} - - - -#### -# Build Makefile -#### -build_Makefile() { - $RM_EXE -f Makefile - echo "# Sharedaemon Web Interface" > Makefile - echo "# Auto generated Makefile" >> Makefile - echo "# Author : Mikael Barbeaux" >> Makefile - echo "" >> Makefile - echo "# Path to compiler binary" >> Makefile - echo "CC = $COMP_EXE" >> Makefile - echo "" >> Makefile - echo "# Path to make binary" >> Makefile - echo "MAKE = $MAKE_EXE" >> Makefile - echo "" >> Makefile - echo "# Path to ar binary" >> Makefile - echo "AR = $AR_EXE" >> Makefile - echo "" >> Makefile - echo "# Path to rm binary" >> Makefile - echo "RM = $RM_EXE" >> Makefile - echo "" >> Makefile - echo "# Path to strip binary" >> Makefile - echo "STRIP = $STRIP_EXE" >> Makefile - echo "" >> Makefile - echo "# Name of output binary" >> Makefile - OS_TEST=`uname -n` - if test $OS_TEST = "WINDOWS" - then - echo "BIN = ui-web.exe" >> Makefile - elif test $OS_TEST = "windows" - then - echo "BIN = ui-web.exe" >> Makefile - else - echo "BIN = ui-web" >> Makefile - fi - echo "" >> Makefile - echo "# Common objects" >> Makefile - echo "OBJECTS = $OTHER_OBJS" >> Makefile - echo "" >> Makefile - echo "# Thread lib objects" >> Makefile - echo "THREADS_OBJECTS = $THREADS_OBJS" >> Makefile - echo "$EXC_OBJ" >> Makefile - echo "$THREAD_EXCP_OBJ" >> Makefile - echo "" >> Makefile - echo "# Libraries" >> Makefile - OS_TEST=`uname -s | cut -c1-5` - if test $OS_TEST = "MINGW" - then - echo "LIBS = -L. -lws2_32 -lsd_threads" >> Makefile - else - echo "LIBS = -L. -lpthread -lsd_threads" >> Makefile - fi - echo "" >> Makefile - echo "# Flags" >> Makefile - if test $OS_TEST = "MINGW" - then - echo "CCFLAGS = -D_WIN32_" >> Makefile - else - echo "CCFLAGS =" >> Makefile - fi - echo "" - - - echo "all : clean \$(BIN) strip" >> Makefile - echo "" >> Makefile - - - echo "\$(BIN) : libthread \$(OBJECTS)" >> Makefile - echo " @echo \"\"" >> Makefile - echo " @echo -e \"Creating \$(BIN) binary : \\\\c\"" >> Makefile - echo " @if \$(CC) -o \$(BIN) \$(OBJECTS) \$(LIBS) 2> .error; then \\" >> Makefile - echo " if test -s .error; then \\" >> Makefile - echo " echo -e \"Created with warnings :\"; \\" >> Makefile - echo " cat .error; \\" >> Makefile - echo " \$(RM) -f .error; \\" >> Makefile - echo " else \\" >> Makefile - echo " echo -e \"ok\"; \\" >> Makefile - echo " fi; \\" >> Makefile - echo " else \\" >> Makefile - echo " echo -e \"Creation failed : \"; \\" >> Makefile - echo " cat .error ; \\" >> Makefile - echo " \$(RM) -f .error; \\" >> Makefile - echo " false; \\" >> Makefile - echo " fi;" >> Makefile - echo "" >> Makefile - - - echo "libthread : \$(THREADS_OBJECTS)" >> Makefile - echo " @echo \"\"" >> Makefile - echo " @echo -e \"Creating libsd_threads.a library : \\\\c\"" >> Makefile - echo " @if \$(AR) -r libsd_threads.a \$(THREADS_OBJECTS) 2> .error; then \\" >> Makefile - echo " if test -s .error; then \\" >> Makefile - echo " echo -e \"Created with warnings :\"; \\" >> Makefile - echo " cat .error; \\" >> Makefile - echo " \$(RM) -f .error; \\" >> Makefile - echo " else \\" >> Makefile - echo " echo -e \"ok\"; \\" >> Makefile - echo " fi; \\" >> Makefile - echo " else \\" >> Makefile - echo " echo -e \"Creation failed : \"; \\" >> Makefile - echo " cat .error ; \\" >> Makefile - echo " \$(RM) -f .error; \\" >> Makefile - echo " false; \\" >> Makefile - echo " fi;" >> Makefile - echo " @echo \"\"" >> Makefile - echo "" >> Makefile - - - echo "%.o : %.cpp" >> Makefile - echo " @echo -e \"Compiling \$< : \\\\c\"" >> Makefile - echo " @if \$(CC) \$(CCFLAGS) -o \$@ -c \$< 2>.error; then \\" >> Makefile - echo " if test -s .error; then \\" >> Makefile - echo " echo -e \"Created with warnings :\"; \\" >> Makefile - echo " cat .error; \\" >> Makefile - echo " \$(RM) -f .error; \\" >> Makefile - echo " else \\" >> Makefile - echo " echo -e \"ok\"; \\" >> Makefile - echo " fi; \\" >> Makefile - echo " else \\" >> Makefile - echo " echo -e \"Creation failed : \"; \\" >> Makefile - echo " cat .error ; \\" >> Makefile - echo " \$(RM) -f .error; \\" >> Makefile - echo " false; \\" >> Makefile - echo " fi;" >> Makefile - echo "" >> Makefile - - - echo "strip:" >> Makefile - echo " @echo \"Stripping...\"" >> Makefile - echo " @if \$(STRIP) \$(BIN) 2> .error; then \\" >> Makefile - echo " \$(RM) -f .error; \\" >> Makefile - echo " fi" >> Makefile - echo "" >> Makefile - - echo ".PHONY : clean" >> Makefile - echo "" >> Makefile - - echo "clean :" >> Makefile - echo " @echo -e \"Cleaning up : \\\\c\"; " >> Makefile - echo " @if \$(RM) -f \$(BIN) libsd_threads.a \$(OBJECTS) \$(THREADS_OBJECTS) 2> .error; then \\" >> Makefile - echo " echo -e \"ok\"; \\" >> Makefile - echo " \$(RM) -f .error; \\" >> Makefile - echo " fi; \\" >> Makefile - echo " echo \"\"">> Makefile - echo "" >> Makefile - - echo "" >> Makefile - echo "" >> Makefile - -} - - - - -#### -# Other OS help -#### -other_os() { - echo "Your current plateform is : Unknown" - echo "This script cannot compile the program." - echo "Contact me for more informations :" - echo "mik...@us..." - echo "" - echo "Exiting." -} - - - -#### -# Displays help -#### -help() { - echo "Available options for configure :" - echo " --help" - echo " displays this help" - echo " --optimize" - echo " enable optimization flags" - echo " --debug" - echo " enable debugging" -} - - - -#### -# Displays compilation help -#### -help_comp() { - echo "compilation help" - exit; -} - - - - -#### -# Objects -#### -THREADS_OBJS=`find . -name '*.cpp' | grep thread | sed -e 's/.cpp/.o \\\/'` -EXC_OBJ=`find . -name '*.cpp' | grep /Exception.cpp | sed -e 's/.cpp/.o \\\/'` -THREAD_EXCP_OBJ=`find . -name '*.cpp' | grep /ThreadException.cpp | sed -e 's/.cpp/.o \\\/'` -OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/ThreadException.cpp/d' | sed '/\/thread/d' | sed -e 's/.cpp/.o \\\/'` - - -#### -# Main script -#### - -echo "ShareDaemon Web Interface - configure script" -echo "Written by MikaelB" -CONF_OPTIONS=$1 - - -if test -n "$CONF_OPTIONS" -a "$CONF_OPTIONS" = "--help" -then - help; -else - check_config; -fi - -OS=`uname -n` -SYSTEM=`uname -s` -echo "" -echo "Check system : $OS - $SYSTEM" - -echo "Building Makefile..." -build_Makefile; -echo "" -echo "Configure script successfully ended." -echo "Now, type \"make\" for compiling the software." - -# End +#!/bin/sh +# Configure script for ShareDaemon Web Interface + +# +# This file is part of webInterface. +# Copyright (C) 2003 Mikael Barbeaux <mik...@us...> +# +# 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 +# + + + +#### +# Check configuration +#### +check_config() { + echo "" + + check_command g++ + COMP_EXE=$COMM + + check_command make + MAKE_EXE=$COMM + + check_command ar + AR_EXE=$COMM + + check_command rm + RM_EXE=$COMM + + check_command strip + STRIP_EXE=$COMM + + check_command uname + UNAME_EXE=$COMM + + check_lib stdc++ libstdc++.a + + OS_TEST=`uname -s | cut -c1-5` + if test $OS_TEST = "MINGW" + then + check_lib winsock libws2_32.a + fi +} + + + +#### +# Check for a command +#### +check_command() { + COMM=`which $1` + if test -z ${COMM} + then + echo "Checking for $1 not found" + help_comp; + else + echo "Checking for $1 ${COMM}" + fi +} + + + +#### +# Check for library +#### +check_lib() { + LIBNAME=$1 + LIB=`$COMP_EXE -print-file-name=$2` + if test $LIB = $LIBNAME + then + echo "Checking for $LIBNAME not found" + help_comp; + else + echo "Checking for $LIBNAME found" + fi +} + + + +#### +# Build Makefile +#### +build_Makefile() { + $RM_EXE -f Makefile + echo "# Sharedaemon Web Interface" > Makefile + echo "# Auto generated Makefile" >> Makefile + echo "# Author : Mikael Barbeaux" >> Makefile + echo "" >> Makefile + echo "# Path to compiler binary" >> Makefile + echo "CC = $COMP_EXE" >> Makefile + echo "" >> Makefile + echo "# Path to make binary" >> Makefile + echo "MAKE = $MAKE_EXE" >> Makefile + echo "" >> Makefile + echo "# Path to ar binary" >> Makefile + echo "AR = $AR_EXE" >> Makefile + echo "" >> Makefile + echo "# Path to rm binary" >> Makefile + echo "RM = $RM_EXE" >> Makefile + echo "" >> Makefile + echo "# Path to strip binary" >> Makefile + echo "STRIP = $STRIP_EXE" >> Makefile + echo "" >> Makefile + echo "# Name of output binary" >> Makefile + OS_TEST=`uname -n` + if test $OS_TEST = "WINDOWS" + then + echo "BIN = ui-web.exe" >> Makefile + elif test $OS_TEST = "windows" + then + echo "BIN = ui-web.exe" >> Makefile + else + echo "BIN = ui-web" >> Makefile + fi + echo "" >> Makefile + echo "# Common objects" >> Makefile + echo "OBJECTS = $OTHER_OBJS" >> Makefile + echo "" >> Makefile + echo "# Thread lib objects" >> Makefile + echo "THREADS_OBJECTS = $THREADS_OBJS" >> Makefile + echo "$EXC_OBJ" >> Makefile + echo "$THREAD_EXCP_OBJ" >> Makefile + echo "" >> Makefile + echo "# Libraries" >> Makefile + OS_TEST=`uname -s | cut -c1-5` + if test $OS_TEST = "MINGW" + then + echo "LIBS = -L. -lws2_32 -lsd_threads" >> Makefile + else + echo "LIBS = -L. -lpthread -lsd_threads" >> Makefile + fi + echo "" >> Makefile + echo "# Flags" >> Makefile + if test $OS_TEST = "MINGW" + then + echo "CCFLAGS = -D_WIN32_" >> Makefile + else + echo "CCFLAGS =" >> Makefile + fi + echo "" + + + echo "all : clean \$(BIN) strip" >> Makefile + echo "" >> Makefile + + + echo "\$(BIN) : libthread \$(OBJECTS)" >> Makefile + echo " @echo \"\"" >> Makefile + echo " @echo -e \"Creating \$(BIN) binary : \\\\c\"" >> Makefile + echo " @if \$(CC) -o \$(BIN) \$(OBJECTS) \$(LIBS) 2> .error; then \\" >> Makefile + echo " if test -s .error; then \\" >> Makefile + echo " echo -e \"Created with warnings :\"; \\" >> Makefile + echo " cat .error; \\" >> Makefile + echo " \$(RM) -f .error; \\" >> Makefile + echo " else \\" >> Makefile + echo " echo -e \"ok\"; \\" >> Makefile + echo " fi; \\" >> Makefile + echo " else \\" >> Makefile + echo " echo -e \"Creation failed : \"; \\" >> Makefile + echo " cat .error ; \\" >> Makefile + echo " \$(RM) -f .error; \\" >> Makefile + echo " false; \\" >> Makefile + echo " fi;" >> Makefile + echo "" >> Makefile + + + echo "libthread : \$(THREADS_OBJECTS)" >> Makefile + echo " @echo \"\"" >> Makefile + echo " @echo -e \"Creating libsd_threads.a library : \\\\c\"" >> Makefile + echo " @if \$(AR) -r libsd_threads.a \$(THREADS_OBJECTS) 2> .error; then \\" >> Makefile + echo " if test -s .error; then \\" >> Makefile + echo " echo -e \"Created with warnings :\"; \\" >> Makefile + echo " cat .error; \\" >> Makefile + echo " \$(RM) -f .error; \\" >> Makefile + echo " else \\" >> Makefile + echo " echo -e \"ok\"; \\" >> Makefile + echo " fi; \\" >> Makefile + echo " else \\" >> Makefile + echo " echo -e \"Creation failed : \"; \\" >> Makefile + echo " cat .error ; \\" >> Makefile + echo " \$(RM) -f .error; \\" >> Makefile + echo " false; \\" >> Makefile + echo " fi;" >> Makefile + echo " @echo \"\"" >> Makefile + echo "" >> Makefile + + + echo "%.o : %.cpp" >> Makefile + echo " @echo -e \"Compiling \$< : \\\\c\"" >> Makefile + echo " @if \$(CC) \$(CCFLAGS) -o \$@ -c \$< 2>.error; then \\" >> Makefile + echo " if test -s .error; then \\" >> Makefile + echo " echo -e \"Created with warnings :\"; \\" >> Makefile + echo " cat .error; \\" >> Makefile + echo " \$(RM) -f .error; \\" >> Makefile + echo " else \\" >> Makefile + echo " echo -e \"ok\"; \\" >> Makefile + echo " fi; \\" >> Makefile + echo " else \\" >> Makefile + echo " echo -e \"Creation failed : \"; \\" >> Makefile + echo " cat .error ; \\" >> Makefile + echo " \$(RM) -f .error; \\" >> Makefile + echo " false; \\" >> Makefile + echo " fi;" >> Makefile + echo "" >> Makefile + + + echo "strip:" >> Makefile + echo " @echo \"Stripping...\"" >> Makefile + echo " @if \$(STRIP) \$(BIN) 2> .error; then \\" >> Makefile + echo " \$(RM) -f .error; \\" >> Makefile + echo " fi" >> Makefile + echo "" >> Makefile + + echo ".PHONY : clean" >> Makefile + echo "" >> Makefile + + echo "clean :" >> Makefile + echo " @echo -e \"Cleaning up : \\\\c\"; " >> Makefile + echo " @if \$(RM) -f \$(BIN) libsd_threads.a \$(OBJECTS) \$(THREADS_OBJECTS) 2> .error; then \\" >> Makefile + echo " echo -e \"ok\"; \\" >> Makefile + echo " \$(RM) -f .error; \\" >> Makefile + echo " fi; \\" >> Makefile + echo " echo \"\"">> Makefile + echo "" >> Makefile + + echo "" >> Makefile + echo "" >> Makefile + +} + + + + +#### +# Other OS help +#### +other_os() { + echo "Your current plateform is : Unknown" + echo "This script cannot compile the program." + echo "Contact me for more informations :" + echo "mik...@us..." + echo "" + echo "Exiting." +} + + + +#### +# Displays help +#### +help() { + echo "Available options for configure :" + echo " --help" + echo " displays this help" + echo " --optimize" + echo " enable optimization flags" + echo " --debug" + echo " enable debugging" +} + + + +#### +# Displays compilation help +#### +help_comp() { + echo "compilation help" + exit; +} + + + + +#### +# Objects +#### +THREADS_OBJS=`find . -name '*.cpp' | grep thread | sed -e 's/.cpp/.o \\\/'` +EXC_OBJ=`find . -name '*.cpp' | grep /Exception.cpp | sed -e 's/.cpp/.o \\\/'` +THREAD_EXCP_OBJ=`find . -name '*.cpp' | grep /ThreadException.cpp | sed -e 's/.cpp/.o \\\/'` +OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/ThreadException.cpp/d' | sed '/\/thread/d' | sed -e 's/.cpp/.o \\\/'` + + +#### +# Main script +#### + +echo "ShareDaemon Web Interface - configure script" +echo "Written by MikaelB" +CONF_OPTIONS=$1 + + +if test -n "$CONF_OPTIONS" -a "$CONF_OPTIONS" = "--help" +then + help; +else + check_config; +fi + +OS=`uname -n` +SYSTEM=`uname -s` +echo "" +echo "Check system : $OS - $SYSTEM" + +echo "Building Makefile..." +build_Makefile; +echo "" +echo "Configure script successfully ended." +echo "Now, type \"make\" for compiling the software." + +# End |
From: <mik...@us...> - 2003-12-29 16:33:47
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv23696 Modified Files: configure ChangeLog Log Message: 29/12/2003 Mikael Barbeaux * Fixed a little bug into configure script. Index: configure =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/configure,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- configure 29 Dec 2003 16:05:37 -0000 1.1 +++ configure 29 Dec 2003 16:33:44 -0000 1.2 @@ -119,6 +119,9 @@ if test $OS_TEST = "WINDOWS" then echo "BIN = ui-web.exe" >> Makefile + elif test $OS_TEST = "windows" + then + echo "BIN = ui-web.exe" >> Makefile else echo "BIN = ui-web" >> Makefile fi @@ -129,6 +132,7 @@ echo "# Thread lib objects" >> Makefile echo "THREADS_OBJECTS = $THREADS_OBJS" >> Makefile echo "$EXC_OBJ" >> Makefile + echo "$THREAD_EXCP_OBJ" >> Makefile echo "" >> Makefile echo "# Libraries" >> Makefile OS_TEST=`uname -s | cut -c1-5` @@ -285,7 +289,8 @@ #### THREADS_OBJS=`find . -name '*.cpp' | grep thread | sed -e 's/.cpp/.o \\\/'` EXC_OBJ=`find . -name '*.cpp' | grep /Exception.cpp | sed -e 's/.cpp/.o \\\/'` -OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/thread/d' | sed -e 's/.cpp/.o \\\/'` +THREAD_EXCP_OBJ=`find . -name '*.cpp' | grep /ThreadException.cpp | sed -e 's/.cpp/.o \\\/'` +OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/ThreadException.cpp/d' | sed '/\/thread/d' | sed -e 's/.cpp/.o \\\/'` #### Index: ChangeLog =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ChangeLog 29 Dec 2003 16:05:37 -0000 1.17 +++ ChangeLog 29 Dec 2003 16:33:44 -0000 1.18 @@ -24,6 +24,7 @@ ----------------------------------------------------------- 29/12/2003 Mikael Barbeaux + * Fixed a little bug into configure script. * Wrote a configure script that auto generates a Makefile for the current plateform. |
Update of /cvsroot/sharedaemon/sharedaemon-ui-web In directory sc8-pr-cvs1:/tmp/cvs-serv17459 Modified Files: ChangeLog INSTALL Added Files: configure Removed Files: Makefile.win Makefile.lin Makefile.bsd Makefile.osx Log Message: 29/12/2003 Mikael Barbeaux * Wrote a configure script that auto generates a Makefile for the current plateform. --- NEW FILE: configure --- #!/bin/sh # Configure script for ShareDaemon Web Interface # # This file is part of webInterface. # Copyright (C) 2003 Mikael Barbeaux <mik...@us...> # # 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 # #### # Check configuration #### check_config() { echo "" check_command g++ COMP_EXE=$COMM check_command make MAKE_EXE=$COMM check_command ar AR_EXE=$COMM check_command rm RM_EXE=$COMM check_command strip STRIP_EXE=$COMM check_command uname UNAME_EXE=$COMM check_lib stdc++ libstdc++.a OS_TEST=`uname -s | cut -c1-5` if test $OS_TEST = "MINGW" then check_lib winsock libws2_32.a fi } #### # Check for a command #### check_command() { COMM=`which $1` if test -z ${COMM} then echo "Checking for $1 not found" help_comp; else echo "Checking for $1 ${COMM}" fi } #### # Check for library #### check_lib() { LIBNAME=$1 LIB=`$COMP_EXE -print-file-name=$2` if test $LIB = $LIBNAME then echo "Checking for $LIBNAME not found" help_comp; else echo "Checking for $LIBNAME found" fi } #### # Build Makefile #### build_Makefile() { $RM_EXE -f Makefile echo "# Sharedaemon Web Interface" > Makefile echo "# Auto generated Makefile" >> Makefile echo "# Author : Mikael Barbeaux" >> Makefile echo "" >> Makefile echo "# Path to compiler binary" >> Makefile echo "CC = $COMP_EXE" >> Makefile echo "" >> Makefile echo "# Path to make binary" >> Makefile echo "MAKE = $MAKE_EXE" >> Makefile echo "" >> Makefile echo "# Path to ar binary" >> Makefile echo "AR = $AR_EXE" >> Makefile echo "" >> Makefile echo "# Path to rm binary" >> Makefile echo "RM = $RM_EXE" >> Makefile echo "" >> Makefile echo "# Path to strip binary" >> Makefile echo "STRIP = $STRIP_EXE" >> Makefile echo "" >> Makefile echo "# Name of output binary" >> Makefile OS_TEST=`uname -n` if test $OS_TEST = "WINDOWS" then echo "BIN = ui-web.exe" >> Makefile else echo "BIN = ui-web" >> Makefile fi echo "" >> Makefile echo "# Common objects" >> Makefile echo "OBJECTS = $OTHER_OBJS" >> Makefile echo "" >> Makefile echo "# Thread lib objects" >> Makefile echo "THREADS_OBJECTS = $THREADS_OBJS" >> Makefile echo "$EXC_OBJ" >> Makefile echo "" >> Makefile echo "# Libraries" >> Makefile OS_TEST=`uname -s | cut -c1-5` if test $OS_TEST = "MINGW" then echo "LIBS = -L. -lws2_32 -lsd_threads" >> Makefile else echo "LIBS = -L. -lpthread -lsd_threads" >> Makefile fi echo "" >> Makefile echo "# Flags" >> Makefile if test $OS_TEST = "MINGW" then echo "CCFLAGS = -D_WIN32_" >> Makefile else echo "CCFLAGS =" >> Makefile fi echo "" echo "all : clean \$(BIN) strip" >> Makefile echo "" >> Makefile echo "\$(BIN) : libthread \$(OBJECTS)" >> Makefile echo " @echo \"\"" >> Makefile echo " @echo -e \"Creating \$(BIN) binary : \\\\c\"" >> Makefile echo " @if \$(CC) -o \$(BIN) \$(OBJECTS) \$(LIBS) 2> .error; then \\" >> Makefile echo " if test -s .error; then \\" >> Makefile echo " echo -e \"Created with warnings :\"; \\" >> Makefile echo " cat .error; \\" >> Makefile echo " \$(RM) -f .error; \\" >> Makefile echo " else \\" >> Makefile echo " echo -e \"ok\"; \\" >> Makefile echo " fi; \\" >> Makefile echo " else \\" >> Makefile echo " echo -e \"Creation failed : \"; \\" >> Makefile echo " cat .error ; \\" >> Makefile echo " \$(RM) -f .error; \\" >> Makefile echo " false; \\" >> Makefile echo " fi;" >> Makefile echo "" >> Makefile echo "libthread : \$(THREADS_OBJECTS)" >> Makefile echo " @echo \"\"" >> Makefile echo " @echo -e \"Creating libsd_threads.a library : \\\\c\"" >> Makefile echo " @if \$(AR) -r libsd_threads.a \$(THREADS_OBJECTS) 2> .error; then \\" >> Makefile echo " if test -s .error; then \\" >> Makefile echo " echo -e \"Created with warnings :\"; \\" >> Makefile echo " cat .error; \\" >> Makefile echo " \$(RM) -f .error; \\" >> Makefile echo " else \\" >> Makefile echo " echo -e \"ok\"; \\" >> Makefile echo " fi; \\" >> Makefile echo " else \\" >> Makefile echo " echo -e \"Creation failed : \"; \\" >> Makefile echo " cat .error ; \\" >> Makefile echo " \$(RM) -f .error; \\" >> Makefile echo " false; \\" >> Makefile echo " fi;" >> Makefile echo " @echo \"\"" >> Makefile echo "" >> Makefile echo "%.o : %.cpp" >> Makefile echo " @echo -e \"Compiling \$< : \\\\c\"" >> Makefile echo " @if \$(CC) \$(CCFLAGS) -o \$@ -c \$< 2>.error; then \\" >> Makefile echo " if test -s .error; then \\" >> Makefile echo " echo -e \"Created with warnings :\"; \\" >> Makefile echo " cat .error; \\" >> Makefile echo " \$(RM) -f .error; \\" >> Makefile echo " else \\" >> Makefile echo " echo -e \"ok\"; \\" >> Makefile echo " fi; \\" >> Makefile echo " else \\" >> Makefile echo " echo -e \"Creation failed : \"; \\" >> Makefile echo " cat .error ; \\" >> Makefile echo " \$(RM) -f .error; \\" >> Makefile echo " false; \\" >> Makefile echo " fi;" >> Makefile echo "" >> Makefile echo "strip:" >> Makefile echo " @echo \"Stripping...\"" >> Makefile echo " @if \$(STRIP) \$(BIN) 2> .error; then \\" >> Makefile echo " \$(RM) -f .error; \\" >> Makefile echo " fi" >> Makefile echo "" >> Makefile echo ".PHONY : clean" >> Makefile echo "" >> Makefile echo "clean :" >> Makefile echo " @echo -e \"Cleaning up : \\\\c\"; " >> Makefile echo " @if \$(RM) -f \$(BIN) libsd_threads.a \$(OBJECTS) \$(THREADS_OBJECTS) 2> .error; then \\" >> Makefile echo " echo -e \"ok\"; \\" >> Makefile echo " \$(RM) -f .error; \\" >> Makefile echo " fi; \\" >> Makefile echo " echo \"\"">> Makefile echo "" >> Makefile echo "" >> Makefile echo "" >> Makefile } #### # Other OS help #### other_os() { echo "Your current plateform is : Unknown" echo "This script cannot compile the program." echo "Contact me for more informations :" echo "mik...@us..." echo "" echo "Exiting." } #### # Displays help #### help() { echo "Available options for configure :" echo " --help" echo " displays this help" echo " --optimize" echo " enable optimization flags" echo " --debug" echo " enable debugging" } #### # Displays compilation help #### help_comp() { echo "compilation help" exit; } #### # Objects #### THREADS_OBJS=`find . -name '*.cpp' | grep thread | sed -e 's/.cpp/.o \\\/'` EXC_OBJ=`find . -name '*.cpp' | grep /Exception.cpp | sed -e 's/.cpp/.o \\\/'` OTHER_OBJS=`find . -name '*.cpp' | sed '/\/Exception.cpp/d' | sed '/\/thread/d' | sed -e 's/.cpp/.o \\\/'` #### # Main script #### echo "ShareDaemon Web Interface - configure script" echo "Written by MikaelB" CONF_OPTIONS=$1 if test -n "$CONF_OPTIONS" -a "$CONF_OPTIONS" = "--help" then help; else check_config; fi OS=`uname -n` SYSTEM=`uname -s` echo "" echo "Check system : $OS - $SYSTEM" echo "Building Makefile..." build_Makefile; echo "" echo "Configure script successfully ended." echo "Now, type \"make\" for compiling the software." # End Index: ChangeLog =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ChangeLog 28 Dec 2003 13:07:01 -0000 1.16 +++ ChangeLog 29 Dec 2003 16:05:37 -0000 1.17 @@ -23,6 +23,11 @@ ----------------------------------------------------------- +29/12/2003 Mikael Barbeaux + * Wrote a configure script that auto generates a Makefile + for the current plateform. + + Version : 0.1.3pre1 ------------- Index: INSTALL =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/INSTALL,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- INSTALL 24 Dec 2003 14:10:32 -0000 1.2 +++ INSTALL 29 Dec 2003 16:05:37 -0000 1.3 @@ -5,25 +5,20 @@ This version is an early alpha. Compilation has been tester under Win32 ( MinGW and Cygwin ) and Linux, but should also work on FreeBSD and MacOS X ( Cocoa ). -Use the specific plateform Makefiles from compiling the sources, eg : - Makefile.lin : Makefile for Linux / Unix plateforms and win32 Cygwin - Makefile.win : Makefile for win32 MinGW - Makefile.bsd : Makefile for FreeBSD - Makefile.osx : Makefile for MacOS X (Cocoa). - + 1) Compiling from sources Download the lastest sources package ( or retrieve sources from CVS ). Then, go into the directory where your downloaded ( and - unzipped ) the sources and type, depending your plateform : + unzipped ) the sources and type the following : - $> make -f Makefile.lin # if you are on Linux - $> make -f Makefile.win # if you are on win32 MinGW + $> ./configure + $> make Then, to start the program, simply type, depending your plateform : - $> ./ui-web # if you are on Linux + $> ./ui-web # if you are on Linux, FreeBSD or Cocoa $> ui-web.exe # if you are on Windows @@ -36,14 +31,18 @@ If you are under Linux / FreeBSD / MacOS X, you need to have the GCC compiler ( lastest version if possible ) with the C++ standard library installed ( typically they are packaged together ). + If you are under Windows, you have the choice between using Cygwin ( a Linux shell emulator ) or MinGW. I recommand that you use MinGW, because Cygwin binaries are often built with dependencies, whereas MinGW binaries aren't. Moreother, MinGW are much more stable than Cygwin ones. + If you choose to use MinGW, take care to download and install lastest + versions of MinGW, mSYS and mSYS Development ToolKit before compiling + the sources. GCC : http://gcc.gnu.org/ - MinGW : http://www.mingw.org + MinGW, mSYS & mSYS DTK : http://www.mingw.org Cygwin : http://www.cygwin.com --- Makefile.win DELETED --- --- Makefile.lin DELETED --- --- Makefile.bsd DELETED --- --- Makefile.osx DELETED --- |
From: <mik...@us...> - 2003-12-29 16:05:40
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/test In directory sc8-pr-cvs1:/tmp/cvs-serv17459/src/test Modified Files: TestSocket.cpp Log Message: 29/12/2003 Mikael Barbeaux * Wrote a configure script that auto generates a Makefile for the current plateform. Index: TestSocket.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/test/TestSocket.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TestSocket.cpp 27 Dec 2003 10:50:08 -0000 1.4 +++ TestSocket.cpp 29 Dec 2003 16:05:37 -0000 1.5 @@ -57,7 +57,7 @@ cout << "Validates the server socket..." << endl; server.validate(); cout << "Bind server socket on port 4589..." << endl; - server.bind(4589); + server.bind(4662); cout << "Listening for connections..." << endl; server.listen(5); cout << "Take your browser to test \"http://localhost:4589\"..." << endl; @@ -80,7 +80,7 @@ } catch(Exception& e) { // display the exception message - //cout << e.getMessage() << endl; + cout << e.getMessage() << endl; } cout << "Could you connect to the socket and did you see the response ?" << endl; cout << " If no => VERY BAD :(" << endl; |
From: <ma...@us...> - 2003-12-29 11:24:33
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv404 Modified Files: MainDlg.cpp Log Message: Temporary fix for crashes during page detaching if menubar is enabled. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- MainDlg.cpp 29 Dec 2003 07:06:18 -0000 1.47 +++ MainDlg.cpp 29 Dec 2003 11:24:30 -0000 1.48 @@ -977,7 +977,11 @@ delete GetToolBar()->RemoveTool(page->id); } if (GetMenuBar() != NULL) { - delete GetMenuBar()->FindItem(page->id); + /** + * Damn, can't delete it here right now, + * will start crashing on page detaching :( + */ +// delete GetMenuBar()->FindItem(page->id); } GetToolBar()->Realize(); |
From: <ma...@us...> - 2003-12-29 09:52:41
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv19070 Modified Files: ServerWnd.cpp ServerWnd.h Log Message: Workaround to implement log scrolling in GTK Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- ServerWnd.cpp 29 Dec 2003 09:25:25 -0000 1.55 +++ ServerWnd.cpp 29 Dec 2003 09:52:38 -0000 1.56 @@ -41,20 +41,22 @@ EVT_BUTTON(ID_ADDTOLIST, CServerWnd::AddNewServer) EVT_BUTTON(ID_UPDATE, CServerWnd::UpdateFromURL) EVT_SIZE(CServerWnd::OnSize) + EVT_TEXT(ID_LOG, CServerWnd::OnAddLogLine) END_EVENT_TABLE() -/* - * Constructor for server window. Loads the server dialog and sets LogBook +/* + * Constructor for server window. Loads the server dialog and sets LogBook * images. */ -CServerWnd::CServerWnd( - wxWindow *parent, wxWindowID id, const wxPoint &position, +CServerWnd::CServerWnd( + wxWindow *parent, wxWindowID id, const wxPoint &position, const wxSize& size, long style ) : wxPanel( parent, id, position, size, style ) { bool show_sidebar; + log_line_count = 0; CreateControls(); - + /** * Read SideBar value from config object, and if it * returns false, toggle (hide) the sidebar. @@ -241,12 +243,14 @@ wxDefaultSize, 0, wxT("log") ); s_log->Add(log_img, 0, wxALL, 5); - wxStaticText *log_txt = new wxStaticText(bottom_panel, -1, _("Log")); + wxStaticText *log_txt = new wxStaticText( + bottom_panel, ID_LOG, _("Log") + ); s_log->Add(log_txt, 0, wxALL, 5); s_bottom->Add(s_log); wxTextCtrl *txt_logs = new wxTextCtrl( bottom_panel, ID_LOG, wxEmptyString, wxDefaultPosition, - wxDefaultSize, + wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL ); new wxLogChain(new wxLogTextCtrl(txt_logs)); @@ -623,4 +627,19 @@ } return item0; +} + +/*************************************************************** OnAddLogLine */ +/* Only needed on GTK to keep last line in log always visible. We remember */ +/* the number of lines in the control in @log_line_count and show the correct */ +/* line each time. Note that we can't use wxTextCtrl::GetNumberOfLines(), */ +/* since on GTK, it calculates the number of lines by actually counting them, */ +/* thus could get really cpu-hungry if there are large amount of lines here. */ +/******************************************************************************/ +void CServerWnd::OnAddLogLine(wxCommandEvent &event) { +#ifndef __WXMSW__ + GetLog()->ShowPosition(log_line_count); + log_line_count++; +#endif + event.Skip(); } Index: ServerWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- ServerWnd.h 29 Dec 2003 09:25:25 -0000 1.33 +++ ServerWnd.h 29 Dec 2003 09:52:38 -0000 1.34 @@ -59,6 +59,7 @@ DECLARE_EVENT_TABLE() /* Member event handlers */ void ToggleSidebar(wxCommandEvent &event); + void OnAddLogLine(wxCommandEvent &event); /* Member function declarations */ void AddNewServer(); @@ -86,6 +87,8 @@ /* Sidebar and its panels */ wxPanel *sidebar; + long log_line_count; + /* Splitter window and its panels */ wxPanel *top_panel, *bottom_panel; wxSplitterWindow *splatter; @@ -94,6 +97,9 @@ wxFlexGridSizer *mainsizer; /* Getters for dialog controls */ + wxTextCtrl* GetLog() { + return (wxTextCtrl*) FindWindow( ID_LOG ); + } wxButton* GetUpdate() { return (wxButton*) FindWindow( ID_UPDATE ); } |
From: <ma...@us...> - 2003-12-29 09:25:28
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv15965 Modified Files: SearchWnd.cpp ServerWnd.cpp ServerWnd.h Log Message: Removed no longer used logging functions Index: SearchWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchWnd.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- SearchWnd.cpp 30 Nov 2003 20:38:36 -0000 1.16 +++ SearchWnd.cpp 29 Dec 2003 09:25:25 -0000 1.17 @@ -69,5 +69,4 @@ */ void CSearchWnd::StartNewSearch(wxCommandEvent &event) { m_searchstring = GetSearchString()->GetValue(); - serverwnd->AddLogLine(m_searchstring, true); } Index: ServerWnd.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- ServerWnd.cpp 29 Dec 2003 06:22:42 -0000 1.54 +++ ServerWnd.cpp 29 Dec 2003 09:25:25 -0000 1.55 @@ -93,45 +93,10 @@ m_config->Write(wxT("SideBar"), sidebar->IsShown()); } -/** - * These three almost identical methods add a line of [text] into the - * corresponding log listctrls, optionally also displaying it in statusbar. - * All lines will be added current date/time before it, and listctrls - * are scrolled to display the last added line. - */ -void CServerWnd::AddDebugLine(wxString text, bool status) { - if (status) { - mainframe->GetStatusText()->SetLabel(text); - } - - wxDateTime now = wxDateTime::Now(); - text = wxString::Format( - wxT("[%s] %s\n"), now.Format(wxT("%c")).c_str(), text.c_str() - ); - - GetDebugLog()->AppendText(text); - GetDebugLog()->ShowPosition(GetDebugLog()->GetLastPosition()); -} - -void CServerWnd::AddLogLine(wxString text, bool status) { - if (status) { - mainframe->GetStatusText()->SetLabel(text); - } - - wxDateTime now = wxDateTime::Now(); - text = wxString::Format( - wxT("[%s] %s\n"), now.Format(wxT("%c")).c_str(), text.c_str() - ); - - GetLog()->AppendText(text); - GetLog()->ShowPosition(GetLog()->GetLastPosition()); -} - /* * Add new server to servers list. */ void CServerWnd::AddNewServer() { - AddDebugLine(wxT("Add New Server button clicked.")); } /* @@ -139,7 +104,6 @@ * to server list. */ void CServerWnd::UpdateFromURL() { - AddDebugLine(wxT("Update Server List from URL button clicked.")); } /* Creates server page controls */ Index: ServerWnd.h =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- ServerWnd.h 29 Dec 2003 06:08:48 -0000 1.32 +++ ServerWnd.h 29 Dec 2003 09:25:25 -0000 1.33 @@ -54,9 +54,6 @@ wxNO_FULL_REPAINT_ON_RESIZE ); virtual ~CServerWnd(); - void AddLogLine(wxString text, bool status = false); - void AddDebugLine(wxString text, bool status = false); - void AddServerLogLine(wxString text, bool status = false); private: DECLARE_EVENT_TABLE() @@ -97,15 +94,6 @@ wxFlexGridSizer *mainsizer; /* Getters for dialog controls */ - wxNotebook* GetLogBook() { - return (wxNotebook*) FindWindow( ID_LOGBOOK ); - } - wxTextCtrl* GetLog() { - return (wxTextCtrl*) FindWindow( ID_LOG ); - } - wxTextCtrl* GetDebugLog() { - return (wxTextCtrl*) FindWindow( ID_DEBUGLOG ); - } wxButton* GetUpdate() { return (wxButton*) FindWindow( ID_UPDATE ); } |