Mambo

I know this page is really ugly. I've got better looking stuff at home.

Mambo is really just an idea so far, eventually it will be a GUI shell (desktop/webtop). Right now this stuff is only here for testing of multiple environments for Kawa.

Here is mambo-0.1.zip which is mambo.jar and a few files that will eventually go in the jar. Unzip them.

The source is mambo-0.1src.zip. I have not yet decided how I will distribute Mambo. Please do not redistribute this source in any form. This code is only provided at this time for testing multiple Kawa environments.

A jar for IFC. You can also get IFC at its home page.

I don't have a jar for Kawa handy at the moment. You can get Kawa at its home page.

There are more limitation with this stuff than I can describe, so if you get stymied please wait a week or two and I will have something usable.

Put mambo.jar, ifc.jar, and Kawa in your classpath. Put the *.planb files in the current directory.

Start with 'java to.mambo.Desktop'.

If it gets a null pointer exception on start then the plan file 'main.planb' is not accessible. It should be in the current directory. I will get it to work from the .jar soon.

Click on 'internal' to get a new Scheme (Kawa) console. If you keep the cursor at the end, then it works pretty much just like a tty console. If you move the cursor up in to the text, pressing enter (return) will insert the return and will send the preceding paragraph (the characters following the previous carriage return) as a line to the Kawa interpreter.

With a couple internal consoles open it should look something like this:


Mambo is built with IFC 1.1. Download now.

It mostly seems to work. The biggest problem I have found so far is that 'do' loops only work for the first console to use them. The rest will get an error of '%do-step' undefined. I only tracked that far enough to see that the problem has something to do with the way autoloaded syntax modules work.

If this stuff seems too crude to use, please don't be discouraged, I have plans to make it pretty cool (eventually).

The only part of the current code that matters for Kawa is this (from to.mambo.Desktop):

   public void newInternal()
   {
      Plan plan = Plan.createPlan("internal.planb", this);
      if (plan != null) {
         InternalWindow window = plan.internalWindowWithContents();
         window.setResizable(true);
         window.setCloseable(true);
         window.setContainsDocument(true);

         window.setTitle("Console " + ++consoleNumber);

         Object v = plan.componentNamed("textView");
         if (v instanceof ScrollGroup) {
            v = ((ScrollGroup) v).contentView();
         }

         SchemeShell shell = new SchemeShell(window, (TextView) v);

         window.show();

         window.rootView().setBuffered(true);

         Thread thread = new Future(shell);

         thread.start();
      }
   }
 
class SchemeShell extends Procedure0
   implements WindowOwner, ExtendedTarget
{
   Window   window;
   TextView textView;
   Console  console;

   String   name;

   SchemeShell(Window window, TextView view)
   {
      this.window = window;
      this.textView = view;

      window.setOwner(this);

      name = window.title();

      try {
         console = new Console(view);
      } catch (IOException e) {
         e.printStackTrace();
      }

      console.enable();
   }

   public boolean canPerformCommand(String command)
   {
      return textView.canPerformCommand(command);
   }

   public void performCommand(String command, Object data)
   {
      textView.performCommand(command, data);
   }

   public Object apply0()
   {
      try {
         InPort in = new InPort(console.in, name);
         OutPort out = new OutPort(console.out, name);
         out.setErrDefault(out);

         Shell.run(Environment.getCurrent(), in, out);
      } catch (Exception e) {
         System.err.println("SchemeShell exception:");
         e.printStackTrace();
//      } catch (RuntimeException e) {
//         System.err.println("SchemeShell runtime exception:");
//         e.printStackTrace();
      } finally {
           System.err.println("run done");
      }

      return null;
   }

Copyright (c) 1997 by James P. White. All Rights Reserved.

Last change 12/28/97.