/*
\\         Main.c() Initialises MUI Constructor.
*/

        #include <Global/Main_Global.h>


Object * Start_Interface( Object *CustomList )
{
 Object *Interface;
 Object *Window;
 Interface = ApplicationObject,
   		MUIA_Application_Author     , "CRAY-1",
   		MUIA_Application_Base       , "CONSTRUCTOR",
   		MUIA_Application_Title      , "Constructor",
   		MUIA_Application_Version    , "$VER Constructor V1.00",
   		MUIA_Application_Copyright  , "Big Time Digital Design",
   		MUIA_Application_Description, "A Replacment For MUI Buidler.",
   		SubWindow,Window = WindowObject,
   		      MUIA_Window_Title,"Constructor V1.0",
   		      MUIA_Window_ID, MAKE_ID('C','R','A','Y'),
   		      MUIA_Window_NoMenus, TRUE,   		      
   		      WindowContents,VGroup,
   		          Child,ListviewObject,        //NewObject(ImageListClass->mcc_Class,NULL,   		          
   		                  MUIA_Listview_List,CustomList,
   		                 End,   	
   		          Child,SimpleButton("CRAY"),          		                 	                    		       
   		          End,   		       	   		
   		          End,
            End; 
  set(Window,MUIA_Window_Open,TRUE);
  
  DoMethod(Window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,
            Interface,3,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
      
  return(Interface);
}


void Stop_Interface( Object *Interface )
{
 MUI_DisposeObject(Interface);

}

CreateImageList( void )
{
 return(MUI_CreateCustomClass(NULL,MUIC_Listview,NULL,0,ImageList_Dispatcher));
}

RemoveImageList(struct MUI_CustomClass *Current )
{
  MUI_DeleteCustomClass(Current);
}


void ASM SAVEDS Image_Display( REG(a1) struct EClass *New_Data,
                               REG(a2) char **Array)

{
    char *ImageBuffer;
    ImageBuffer = Allocate_Memory(30);
   printf("Its is State is 0x%lx\n",New_Data->ec_Image);
    sprintf(ImageBuffer,"\33O[%08lx]",New_Data->ec_FormattedImage);
    
    *Array =  ImageBuffer;
    *Array++ = ImageBuffer;
//    *Array   =  New_Data->ClassName;
   
}


struct EClass * ASM SAVEDS Image_Construct( REG(a1) struct EClass *New_One)
{
 printf("Inside The Construct Hook\n");
  New_One->ec_FormattedImage = DoMethod(ClassList,MUIM_List_CreateImage,New_One->ec_Image);
  printf("Finshed With The Construct Hook\n");
 return(New_One);
}

void ASM SAVEDS Image_Destruct(REG(a1) struct EClass *Old_One)
{
 
 DoMethod(ClassList,MUIM_List_DeleteImage,Old_One->ec_FormattedImage);

}






















