The DejaVU Framework -- hush 3.0
[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?

source: hush-js.c hush-3.1/share


[.] - [up] [top] - index make source logic slides talks
  include <hush/hush.h> 
  
  include <iostream.h>
  include <stdio.h>
  
  

x_handler


  class x_handler : public handler {
  int n;
  char buf[20];
  public:
  x_handler(kit* x) { x->_register(this); tk = x; n = 0; }
  int operator()() {
          event* e = _event;
          cerr << "HUSH called  " << n++ << " " << e->ask() << " ";
          cerr << e->type();
          cerr << " " << e->arg(0) << " ";
          cerr << e->arg(1) << " " << e->arg(2) << endl;
          sprintf(buf,"ok-%d",n);
          e->tell(buf);
          return 1;
          }
  };

slide: x_handler

  
  

application


  class application : public session {   
[3]

public: application( int argc, char* argv[] ) : session(argc,argv,"hush") {} int main( ) { cerr << "Main in control" << endl; tk->load("js"); kit* xtk = kit::lookup("js"); xtk->source("js/perfect.js"); xtk->bind("clips", new x_handler(xtk)); xtk->bind("tcl", new x_handler(xtk)); xtk->eval("print(\"I am trying to eval ...\");"); xtk->pack("quit"); return OK; } };

slide: application

  
  int main (int argc, char  **argv) {
      session* s = new application(argc,argv);
      s->depends(0);
      s->run();
      delete s;
      //session::statistics();
      return 0;
  }
  

[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?
Hush Online Technology
hush@cs.vu.nl
11/03/98