From 0570d14683cc05262334ff8bf0d9b5b98d10dfe8 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 11 Nov 2009 09:59:22 -0800 Subject: Cleaning out crap. --- src/Main.cc | 217 ----------------------------------------- src/Makefile.am | 24 ----- src/TestApplet.java | 25 ----- src/data/grain.png | Bin 0 -> 9579 bytes src/data/nobis-logo-small.jpg | Bin 0 -> 187081 bytes src/data/style.css | 13 +++ src/datas/Makefile.am | 1 - src/datas/grain.png | Bin 9579 -> 0 bytes src/datas/nobis-logo-small.jpg | Bin 187081 -> 0 bytes src/datas/style.css | 13 --- src/luac.cc | 96 ------------------ src/misc.cc | 66 ------------- 12 files changed, 13 insertions(+), 442 deletions(-) delete mode 100644 src/Main.cc delete mode 100644 src/Makefile.am delete mode 100644 src/TestApplet.java create mode 100644 src/data/grain.png create mode 100644 src/data/nobis-logo-small.jpg create mode 100644 src/data/style.css delete mode 100644 src/datas/Makefile.am delete mode 100644 src/datas/grain.png delete mode 100644 src/datas/nobis-logo-small.jpg delete mode 100644 src/datas/style.css delete mode 100644 src/luac.cc delete mode 100644 src/misc.cc (limited to 'src') diff --git a/src/Main.cc b/src/Main.cc deleted file mode 100644 index 62e9536..0000000 --- a/src/Main.cc +++ /dev/null @@ -1,217 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include "Handle.h" -#include "Task.h" -#include "TaskMan.h" -#include "HttpServ.h" -#include "Socket.h" -#include "config.h" -#include "Message.h" -#include "Menu.h" -#include "Exceptions.h" -#include "Form.h" -#include "Confirm.h" -#include "Table.h" -#include "InPipe.h" -#include "Image.h" -#include "CopyJob.h" -#include "IRC.h" -#include "Main.h" -#include "gettext.h" - -InPipe * in; - -class ad_run : public Task { - public: - ad_run(Variables * av, Variables * ahds, Handle * ah) : v(*av), hds(*ahds), h(ah) { - SetBurst(); - } - virtual ~ad_run() {} - virtual String GetName() { return "Action dynamique"; } - protected: - virtual int Do() throw (GeneralException) { - pid_t p; - - switch (current) { - case 0: - if (!(p = fork())) { - execlp("uptime", "uptime", NULL); - } - current = 1; - WaitFor(p); - Suspend(TASK_ON_HOLD); - - case 1: - (*in) >> ut; - if (!(p = fork())) { - execlp("uname", "uname", "-a", NULL); - } - current = 2; - WaitFor(p); - Suspend(TASK_ON_HOLD); - - case 2: - (*in) >> un; - for (int i = 0; i < hds.GetNb(); i++) { - shds += hds[i] + "
\n"; - } - - m = new Message("Action dynamique", - String("Vous avez choisi l'action dynamique. L'uptime de la machine est '") + - ut + "' et sa définition complète est '" + un + "'


Voici la liste des entêtes:

" + shds, ""); - - current = 3; - WaitFor(m->Do(&v, &hds, h)); - Suspend(TASK_ON_HOLD); - - case 3: - delete m; - testimg = new Image(100, 100); - testimg->Prepare(); - - testoutput = new Output("TestImg.tga"); - - current = 4; - WaitFor(new CopyJob(testimg, testoutput, -1, true, true)); - Suspend(TASK_ON_HOLD); - - case 4: - return TASK_DONE; - } - return TASK_DONE; - } - private: - Variables v, hds; - Handle * h; - String ut, un, shds; - Action * m; - Image * testimg; - Output * testoutput; -}; - -class ad_t : public Action { - public: - ad_t() : Action("menu6") { } - virtual ~ad_t() { } - virtual String GetTitle() { return "Action dynamique"; } - virtual Task * Do(Variables * v, Variables * hds, Handle * h) { - return new ad_run(v, hds, h); - } -}; -Action * ad = new ad_t(); - -class dostop_t : public Action { - public: - dostop_t() : Action("dostop") { } - virtual ~dostop_t() { } - virtual String GetTitle() { return "Arret du serveur"; } - virtual Task * Do(Variables * v, Variables * hds, Handle * h) { - TaskMan::Stop(); - return 0; - } -}; -Action * dostop = new dostop_t(); - -String Noms[] = {"Champ1", "Champ2", "Champ3"}; -String Defaults[] = {"Default1", "Default2", 0}; -String Invites[] = {"Champ 1:", "Champ 2:", "Champ 3:"}; -String Options[] = {"Option1", "Option2", ""}; -String ODescs[] = {"Description 1", "Description 2", ""}; -String * Lists[] = {0, 0, Options}; -String * Descs[] = {0, 0, ODescs}; -String Titres[] = {"Titre 1", "Titre 2", "Titre 3"}; -String Cells[] = {"L1C1", "L1C2", "L1C3", "L2C1", "L2C2", "L2C3", "L3C1", "L3C2", "L3C3", "L4C1", "L4C2", "L4C3"}; -Action * a1 = new Message("Action 1", "Vous avez cliqué sur l'option 1 du menu", "menu1"); -Action * a2 = new Table("Petite table", "menu2", Titres, Cells, 3, 4); -Action * a3 = new Message("Test d'image", -"Voici un test d'affichage d'image:" -"
", -"menu3"); -Action * a4 = new Form("Test de formulaire...", "menu4", "Rentrez des trucs...", Noms, Invites, Defaults, Lists, Descs, 3); -Action * a5 = new Confirm("Confirmation", "Oui ou non?", "menu5", 0, 0); -Action * java = new Message("Applet JAVA", -"\n" -"
\n" -"\n" -"\n" -"
\n", "java"); - -Action * up = new Message("Test d'upload", -"\n" -"
\n" -"\n" -"Send this file: \n" -"\n" -"
\n", "upload"); - -Action * stop = new Confirm("Stopper", "Stopper le serveur?", "stop", dostop, 0); - -Action * Liste[] = {a1, a2, a3, a4, a5, ad, java, up, stop}; -String Labels[] = {"Action 1", "Action 2", "Action 3", "Action 4", "Action 5", "Action dynamique", "Essai de java", "Test d'upload", "Stop"}; - -CODE_BEGINS - -Action * buildmenu(void) { - Action * m = new Menu("Menu Principal", "start", Labels, Liste, 9); - return m; -} - -int startup() throw (GeneralException) { - verbosity = M_INFO; - - int c; - String port = "1500"; - - std::list testlist; - testlist.push_front("poide"); - - in = new InPipe(); - - in->Hook(); - - String test = "poide\n", r; - std::cout << test; - std::cout.flush(); - (*in) >> r; - if (r != "poide") { - printm(M_ERROR, "The stdout redirect has failed.\n"); - exit(-1); - } - - while ((c = getopt(argc, argv, "p:")) != EOF) { - switch (c) { - case 'p': - port = optarg; - break; - default: - printm(M_BARE, String(_("Usage: ")) + argv[0] + " [-p port]\n"); - exit(-1); - } - } - - try { - HttpServ h(buildmenu(), port.to_int(), "testing"); -// IRC i("botalacon"); -// i.Connect(); -// i.MainLoop(); - TaskMan::MainLoop(); - } - catch (GeneralException e) { - std::cerr << "Main function got an exception: '" << e.GetMsg() << "'.\n"; - exit(-1); - } - - catch (...) { - std::cerr << "Unknow exception.\n" << std::endl; - exit(-1); - } - - delete in; - return 0; -} -CODE_ENDS diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index a6c1b01..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -SUBDIRS = datas - -localedir = $(datadir)/locale -DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ -AM_CFLAGS = -O3 -Wall -Wstrict-prototypes -g -AM_CXXFLAGS = -O3 -Wall -Wstrict-prototypes -g -INCLUDES = -I.. -I../include -I$(includedir) - -noinst_PROGRAMS = Baltisot paq - -noinst_JAVA = TestApplet.java - -JAVAROOT = datas - -Baltisot_SOURCES = Main.cc - -paq_SOURCES = paq.cc - -LDADD = ../lib/libBaltisot.la - -Baltisot_LDADD = $(LDADD) -paq_LDADD = $(LDADD) - -EXTRA_DIST = misc.cc TestApplet.java diff --git a/src/TestApplet.java b/src/TestApplet.java deleted file mode 100644 index cba1811..0000000 --- a/src/TestApplet.java +++ /dev/null @@ -1,25 +0,0 @@ -import javax.swing.*; //This is the final package name. -//import com.sun.java.swing.*; //Used by JDK 1.2 Beta 4 and all - //Swing releases before Swing 1.1 Beta 3. -import java.awt.*; - -public class TestApplet extends JApplet { - - // This is a hack to avoid an ugly error message in 1.1. - public TestApplet() { - getRootPane().putClientProperty("defeatSystemEventQueueCheck", - Boolean.TRUE); - } - - public void init() { - JLabel label = new JLabel( - "You are successfully running a Swing applet!"); - label.setHorizontalAlignment(JLabel.CENTER); - - //Add border. Should use createLineBorder, but then the bottom - //and left lines don't appear -- seems to be an off-by-one error. - label.setBorder(BorderFactory.createMatteBorder(1,1,2,2,Color.black)); - - getContentPane().add(label, BorderLayout.CENTER); - } -} diff --git a/src/data/grain.png b/src/data/grain.png new file mode 100644 index 0000000..632ff82 Binary files /dev/null and b/src/data/grain.png differ diff --git a/src/data/nobis-logo-small.jpg b/src/data/nobis-logo-small.jpg new file mode 100644 index 0000000..de8f9e8 Binary files /dev/null and b/src/data/nobis-logo-small.jpg differ diff --git a/src/data/style.css b/src/data/style.css new file mode 100644 index 0000000..56b2d1f --- /dev/null +++ b/src/data/style.css @@ -0,0 +1,13 @@ +body { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; } +th { font-family: Arial, Helvetica, sans-serif; font-size: 17pt; font-weight: bold; background-color: #D3DCE3;} +td { font-family: Arial, Helvetica, sans-serif; font-size: 15pt;} +form { font-family: Arial, Helvetica, sans-serif; font-size: 15pt} +h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 30pt; font-weight: bold} +A:link { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; text-decoration: none; color: blue} +A:visited { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; text-decoration: none; color: blue} +A:hover { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; text-decoration: underline; color: red} +A:link.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15pt; color: #000000} +A:visited.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15pt; color: #000000} +A:hover.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15pt; color: red;} +.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15pt; color: #000000} + diff --git a/src/datas/Makefile.am b/src/datas/Makefile.am deleted file mode 100644 index b60543d..0000000 --- a/src/datas/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = grain.png style.css nobis-logo-small.jpg diff --git a/src/datas/grain.png b/src/datas/grain.png deleted file mode 100644 index 632ff82..0000000 Binary files a/src/datas/grain.png and /dev/null differ diff --git a/src/datas/nobis-logo-small.jpg b/src/datas/nobis-logo-small.jpg deleted file mode 100644 index de8f9e8..0000000 Binary files a/src/datas/nobis-logo-small.jpg and /dev/null differ diff --git a/src/datas/style.css b/src/datas/style.css deleted file mode 100644 index 56b2d1f..0000000 --- a/src/datas/style.css +++ /dev/null @@ -1,13 +0,0 @@ -body { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; } -th { font-family: Arial, Helvetica, sans-serif; font-size: 17pt; font-weight: bold; background-color: #D3DCE3;} -td { font-family: Arial, Helvetica, sans-serif; font-size: 15pt;} -form { font-family: Arial, Helvetica, sans-serif; font-size: 15pt} -h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 30pt; font-weight: bold} -A:link { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; text-decoration: none; color: blue} -A:visited { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; text-decoration: none; color: blue} -A:hover { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; text-decoration: underline; color: red} -A:link.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15pt; color: #000000} -A:visited.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15pt; color: #000000} -A:hover.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15pt; color: red;} -.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15pt; color: #000000} - diff --git a/src/luac.cc b/src/luac.cc deleted file mode 100644 index 504dac2..0000000 --- a/src/luac.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Baltisot - * Copyright (C) 1999-2008 Nicolas "Pixel" Noble - * - * 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 - -#include -#include -#include -#include - -struct option long_options[] = { - {"help", 0, NULL, 'h'}, - {"verbose", 0, NULL, 'v'}, - {"output", 1, NULL, 'o'}, - {"debug", 0, NULL, 'd'}, - {0, 0, NULL, 0 } -}; - -CODE_BEGINS -void showhelp() { - printm(M_BARE, -"Usage:\n" -"%s [options] [lua-script1] [lua-script2] ...\n" -"\n" -"Options:\n" -" -v sets verbosity.\n" -" -d sets debug mode.\n" -" -o set output filename.\n" -" -l displays listing.\n" -, argv[0]); - -} - -virtual int startup() throw (GeneralException) { - char c; - Lua * L = new Lua(); - bool strip = true; - bool listing = false; - const char * output = "a.clua"; - bool todo; - - while ((c = getopt_long(argc, argv, "Hhvo:dl", long_options, NULL)) != EOF) { - switch (c) { - case 'h': - case 'H': - case '?': - showhelp(); - return 0; - case 'v': - verbosity = M_INFO; - break; - case 'o': - output = strdup(optarg); - break; - case 'd': - strip = false; - break; - case 'l': - listing = true; - break; - } - } - - /* Loading all the scripts */ - while (optind < argc) { - todo = true; - L->load(&Input(argv[optind++]), false); - } - - /* Doh... */ - if (!todo) { - showhelp(); - return 0; - } - - L->dump(&Output(output), strip, listing && verbosity == M_INFO ? 2 : listing ? 1 : 0); - - return 0; -} -CODE_ENDS diff --git a/src/misc.cc b/src/misc.cc deleted file mode 100644 index ea72572..0000000 --- a/src/misc.cc +++ /dev/null @@ -1,66 +0,0 @@ -#include -#include "Handle.h" -#include "String.h" - -void GeneDeroul(Handle * h, String * & l1, String * & l2) { - int count; - list result; - String r1, r2; - - count = 0; - - while (1) { - (*h) >> r1; - (*h) >> r2; - if ((r1 == "") && (r2 == "")) break; - result.push_back(r1); - result.push_back(r2); - count++; - } - - l1 = new String[count + 1]; - l2 = new String[count + 1]; - - for (int i = 0; i < count; i++) { - r1 = result.front(); - result.pop_front(); - r2 = result.front(); - result.pop_front(); - l1[i] = r1; - l2[i] = r2; - } - - l1[count] = ""; - l2[count] = ""; -} - -int GeneList(Handle * h, int nbcol, String * & l) { - int nblig; - list result; - String r; - bool is_null; - - nblig = 0; - while (1) { - is_null = true; - for (int i = 0; i < nbcol; i++) { - (*h) >> r; - result.push_back(r); - if (r != "") is_null = false; - } - if (is_null) break; - nblig++; - } - - l = new String[nbcol * nblig + 1]; - - for (int i = 0; i < (nbcol * nblig); i++) { - r = result.front(); - result.pop_front(); - l[i] = r; - } - - l[nbcol * nblig] = ""; - - return nblig; -} -- cgit v1.2.3