///////////////////////////////////////////////////////////////////////////////
//                             Lisaac Example                                //
//                                                                           //
//                   LSIIT - ULP - CNRS - INRIA - FRANCE                     //
//                                                                           //
//   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 3 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, see <http://www.gnu.org/licenses/>.   //
//                                                                           //
//                     http://isaacproject.u-strasbg.fr/                     //
///////////////////////////////////////////////////////////////////////////////
Section Header
  
  + name      := GRAPH;

  - copyright := "2003-2008 Sonntag Benoit";

  - author    := "Sonntag Benoit (sonntag@icps.u-strasbg.fr)";

Section Inherit

  - parent_any:ANY := ANY;

Section Public
  
  + parent:GRAPH;
  
  + select:SELECT;
  
  - set_select s:SELECT parent p:GRAPH <-
  (
    parent := p;
    select := s;
  );
  
  //
  // Transformation.
  //
  
  - move (dx,dy:INTEGER_32) <-
  ( 
    select.move (dx,dy);
  );
  
  - compute_select <-
  (
    deferred; 
  );
  
  //
  // Display.
  //
  
  - draw_in bmp:ABSTRACT_BITMAP <-
  ( + x0,y0,x1,y1:INTEGER;
    + xmin,ymin,xmax,ymax:INTEGER_32;
    
    (xmin,ymin,xmax,ymax) := select.frame;
    x0 := ecrx xmin;
    y1 := ecry ymin;
    x1 := ecrx xmax;
    y0 := ecry ymax;        
    ((x0 <= bmp.clip_x1) && {x1 >= bmp.clip_x0} && {y0 <= bmp.clip_y1} && {y1 >= bmp.clip_y0}).if {
      direct_draw_in bmp;
    };    
  );
  
Section GRAPH
  
  - direct_draw_in bmp:ABSTRACT_BITMAP <-
  ( 
    deferred;
  );