1. with Directions;                        use Directions; 
  2.  
  3. private with Physics.Clip_Maps; 
  4.  
  5. package Widgets.Containers.Scenes.Ked is 
  6.  
  7.     type Ked_Scene is new Scene with private; 
  8.     type A_Ked_Scene is access all Ked_Scene'Class; 
  9.  
  10.     function Create_Scene( view : not null access Game_Views.Game_View'Class; 
  11.                            id   : String ) return A_Ked_Scene; 
  12.     pragma Precondition( id'Length > 0 ); 
  13.     pragma Postcondition( Create_Scene'Result /= null ); 
  14.  
  15.     function Get_Active_Layer( this : access Ked_Scene ) return Natural; 
  16.  
  17.     -- Gets a bounding box for the scene's target such that the target will 
  18.     -- always be in the center of the scene when it is within these bounds. 
  19.     -- This procedure is only called by the target when it updates its location. 
  20.     procedure Get_Target_Bounds( this   : access Ked_Scene; 
  21.                                  x1, y1, 
  22.                                  x2, y2 : out Float ); 
  23.  
  24.     -- Scrolls the scene view in the direction of 'dir' by one increment. The 
  25.     -- scroll increment size is controlled by the scene.scroll_speed preference. 
  26.     procedure Scroll_Increment( this : access Ked_Scene; 
  27.                                 dir  : Cardinal_Direction ); 
  28.  
  29.     -- Sets the active layer for editing tiles. 
  30.     procedure Set_Active_Layer( this : access Ked_Scene; layer : Positive ); 
  31.  
  32.     -- Sets the visibility for a layer. 
  33.     procedure Set_Layer_Visible( this    : access Ked_Scene; 
  34.                                  layer   : Positive; 
  35.                                  visible : Boolean ); 
  36.  
  37.     -- Resets the zoom factor to 1, keeping the scene focus centered. 
  38.     procedure Zoom_Identity( this : access Ked_Scene ); 
  39.  
  40.     -- Zooms in, keeping the scene focus centered. 
  41.     procedure Zoom_In( this : access Ked_Scene ); 
  42.  
  43.     -- Zooms out, keeping the scene focus centered. 
  44.     procedure Zoom_Out( this : access Ked_Scene ); 
  45.  
  46. private 
  47.  
  48.     use Physics.Clip_Maps; 
  49.  
  50.     type Ked_Scene is new Scene with 
  51.         record 
  52.             leftMouse       : Boolean := False; 
  53.             rightMouse      : Boolean := False; 
  54.             middleMouse     : Boolean := False; 
  55.             activeModifiers : Modifiers_Array := Modifiers_Array'(others=>False); 
  56.             activeLayer     : Natural := 0; 
  57.             scrollSpeed     : Float := 0.0; 
  58.             clipMap         : A_Clip_Map := null; 
  59.         end record; 
  60.  
  61.     procedure Construct( this : access Ked_Scene; 
  62.                          view : not null access Game_Views.Game_View'Class; 
  63.                          id   : String ); 
  64.     pragma Precondition( id'Length > 0 ); 
  65.  
  66.     procedure Delete( this : in out Ked_Scene ); 
  67.  
  68.     procedure Draw_Layer( this   : access Ked_Scene; 
  69.                           dc     : Drawing_Context; 
  70.                           layer  : Positive; 
  71.                           startX, 
  72.                           startY : Integer; 
  73.                           tileX1, 
  74.                           tileY1, 
  75.                           tileX2, 
  76.                           tileY2 : Integer ); 
  77.  
  78.     procedure Draw_Layer_Overlay( this   : access Ked_Scene; 
  79.                                   dc     : Drawing_Context; 
  80.                                   startX, 
  81.                                   startY : Integer; 
  82.                                   tileX1, 
  83.                                   tileY1, 
  84.                                   tileX2, 
  85.                                   tileY2 : Integer ); 
  86.  
  87.     procedure Handle_Entity_Created( this : access Ked_Scene; 
  88.                                      evt  : not null A_Entity_Created_Event ); 
  89.  
  90.     procedure Handle_Exit( this : access Ked_Scene ); 
  91.  
  92.     procedure Handle_Mouse_Move( this : access Ked_Scene; 
  93.                                  evt  : not null A_Mouse_Event ); 
  94.  
  95.     procedure Handle_Mouse_Press( this : access Ked_Scene; 
  96.                                   evt  : not null A_Mouse_Button_Event ); 
  97.  
  98.     procedure Handle_Mouse_Release( this : access Ked_Scene; 
  99.                                     evt  : not null A_Mouse_Button_Event ); 
  100.  
  101.     procedure Handle_New_World( this : access Ked_Scene; 
  102.                                 evt  : not null A_New_World_Event ); 
  103.  
  104.     procedure Handle_Tile_Changed( this : access Ked_Scene; 
  105.                                    evt  : not null A_Tile_Changed_Event ); 
  106.  
  107.     -- Sets the absolute zoom factor for the scene, keeping the current focus 
  108.     -- point centered. 
  109.     procedure Zoom_With_Focus( this : access Ked_Scene; factor : Float ); 
  110.  
  111. end Widgets.Containers.Scenes.Ked;