#include <Stinc.h>
#include "EditorClass.h"
#include <GUI/Main_Window.h>
#include <GUI/Editor_Menus.h>

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- Defines *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/


#ifndef MAKE_ID
#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
#endif
#define InstallCallHook( udata , hookname)\
         Temp = DoMethod(OutMenu,MUIM_FindUData,udata);\
         DoMethod(Temp,MUIM_Notify,MUIA_Menuitem_Trigger,MUIV_EveryTime,\
         MUIV_Notify_Application,2,MUIM_CallHook,&hookname);
         
#define Enable(udata,state)\         
         set(DoMethod(App->Menustrip,MUIM_FindUData,udata),MUIA_Menuitem_Enabled,state);\
         

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-Prototypes*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

#include <Global/FileMenuHooks_Prototypes.c>
#include <Global/EditMenuHooks_Prototypes.c>
#include <Global/ProjectMenuHooks_Prototypes.c>
#include <Global/Memory_Prototypes.c>
#include <Global/Main_Prototypes.c>
#include <Global/SourceClass_Prototypes.c>
#include <Global/ProjectWin_Class_Prototypes.c>
#include <Global/Editormenus_Prototypes.c>

#define EDITVER  "2.1"
#define EDITDATE "06/04/96"

extern struct  Library         *MUIMasterBase;                  
extern struct  InstanceData    *App;                           
                              
struct InstanceData
{
        APTR                            MemoryPool;  
        Object                          *Application; 
        struct  MUI_CustomClass         *Source_Class;
        struct  MUI_CustomClass         *Project_Class;
	struct  MUI_CustomClass		*SourcePanel_Class;
        struct  ObjEditor_Window        *MainWindow; 
        Object				*ProjWindow;
        Object                          *Menustrip;                                 
};


/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-Misc Structs*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

struct SaveProject // For Turbo C++
{
        char    Type[23-1];
        char    Shit[880-1]; 
        char    IncludeHead[4-1];
        char    IncludeDirectory[130-1];
        char    LibHead[4-1];
        char    LibDirectory[130-1];
        char    Status[26-1];
        char    Shit2[1012-1];                  
};      


/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-Source_Class*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

#define SOURCE_TAGS  0x80832000

struct SourceInstance
{
        char    *Source_File;
        char    *Source_FileName;
        char    *Source_FilePath;
        BOOL     Source_Loaded; 
        char     Source_Lines[20];
        Object  *Source_Editor;       
};
/*
enum SourceTags
{
        MUIA_Source_File                = (int) (SOURCE_TAGS +1),       //ISG 
        MUIA_Source_FileName,                                           //--G 
        MUIA_Source_FilePath,                                           //--G         
        MUIA_Source_Loaded,                                             //-SG
        MUIA_Source_Editor,						//--G
        MUIA_Source_Lines,						//-S-
        MUIA_Source_ActiveLine,						//-S-
                
        MUIM_Source_Save               = (int) (SOURCE_TAGS +500),
        MUIM_Source_Load,
        MUIM_Source_Search,
        MUIM_Source_Format,        
        MUIM_Source_GetConfig,
        MUIA_Source_SetConfig,
};*/

/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-Project_Class*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

#define PROJECT_TAGS 0x80086220

struct ProjectInstance
{
        char    *Project_File;
        char    *Project_FileName;
        char    *Project_FilePath;
        char	*Project_Title;
        Object	*Project_Lister;
        
};

enum ProjectTags
{
        MUIA_Project_File               = (int) (PROJECT_TAGS +1),      //ISG
        MUIA_Project_FileName,                                          //--G
        MUIA_Project_FilePath,                                          //--G
        MUIA_Project_Title,						//ISG
        MUIA_Project_Lister,						//--G
                
        MUIM_Project_Save              = (int) (PROJECT_TAGS +500),    
        MUIM_Project_Load,
        MUIM_Project_Close,
        MUIM_Project_Open,
        MUIM_Project_Compile,
        
};

struct OpenProjectMsg
{
	ULONG MethodID;
	char	*FileName;
};


enum
{
        File_New=750,
        File_Open,
        File_Save,
        File_SaveAs,
        File_SaveAll,
        File_Print,  
        File_PrintSetup,
        File_Exit,

        Edit_Undo,
        Edit_Redo,
        Edit_Cut,
        Edit_Copy,
        Edit_Paste,
        Edit_Clear,

        Search_Find,
        Search_Replace,
        Search_Again,
        Search_GoTo,
        Search_PrevErr,
        Search_NextErr,

        Run_Run,
        Run_Args,
        Run_Debug,
        Run_DebugArgs,

        Compile_Compile,
        Compile_Make,
        Compile_Link,
        Compile_Build,
        Compile_Info,
        Compile_RemMess,

        Project_Open,
        Project_Close,
        Project_Add,
        Project_Rem,
        Project_Include,

        Browse_Classes,
        Browse_Functions,
        Browse_Variables,
        Browse_Symbol,
        Browse_Rewind,
        Browse_Overview,
        Browse_Inspect,
        Browse_Goto,
        
        Win_Prj,
        Win_Msg,
               
        Env_Prefs,
        Hlp_About

};

