home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594a.lha / maker_v0.1 / global.h < prev    next >
C/C++ Source or Header  |  1991-07-29  |  5KB  |  151 lines

  1. #ifndef    GLOBAL_H
  2. #define    GLOBAL_H
  3.  
  4. #include "maker.h"
  5. #include "proto.h"
  6.  
  7. #ifdef MAIN
  8.     #define EXPORT
  9. #else
  10.     #define EXPORT    extern
  11. #endif
  12.  
  13. #define    MENU_Project        0
  14. enum { ITEM_About, ITEM_Open, ITEM_SaveAs, ITEM_WriteItems, ITEM_Quit };
  15.  
  16. #define    MENU_Objects        1
  17. enum { ITEM_NewButton, ITEM_NewCheckBox, ITEM_NewCycle, ITEM_NewMX, MO_Break1, 
  18.             ITEM_NewString, ITEM_NewText, ITEM_NewIText, MO_Break2,
  19.             ITEM_NewSlider, ITEM_NewScroller, ITEM_NewListView, MO_Break3,
  20.             ITEM_NewPalette, MO_Break4,
  21.             ITEM_NewRect, ITEM_NewLine };
  22.  
  23. #define    MENU_Control        2
  24. enum { ITEM_EditMode, ITEM_DisableAll, ITEM_BringFront, ITEM_SendBack, ITEM_WindSize,
  25.             ITEM_PickLVString };
  26.  
  27. #define    WIND_IDCMP        IDCMP_CLOSEWINDOW | IDCMP_MENUPICK |                                \
  28.                                 IDCMP_VANILLAKEY | IDCMP_RAWKEY | IDCMP_MOUSEBUTTONS |        \
  29.                                 IDCMP_NEWSIZE | IDCMP_GADGETUP | IDCMP_GADGETDOWN |            \
  30.                                 IDCMP_INTUITICKS | IDCMP_MOUSEMOVE
  31. #define    WIND_FLAG        WFLG_CLOSEGADGET | WFLG_DRAGBAR | WFLG_DEPTHGADGET |            \
  32.                                 WFLG_SMART_REFRESH |    WFLG_NOCAREREFRESH | WFLG_ACTIVATE |    \
  33.                                 WFLG_REPORTMOUSE
  34.  
  35. EXPORT struct Library        *IntuitionBase,
  36.                                     *GfxBase,
  37.                                     *GadToolsBase,
  38.                                     *AslBase,
  39.                                     *LayersBase,
  40.                                     *DiskfontBase;
  41.  
  42. EXPORT Screen                    *gPubScreen;
  43. EXPORT Window                    *gWindPtr, *gInfoWindPtr;
  44. EXPORT struct VisualInfo    *gVI;
  45. EXPORT Menu                        *gMenuPtr;
  46.  
  47. EXPORT LinkNode                *gObjList,
  48.                                     *gSelObj;
  49. EXPORT TimeStamp                gSelTime;
  50. EXPORT Gadget                     *gGadgetContext;
  51. EXPORT BOOL                        gEditMode,
  52.                                     gWindSizeable,
  53.                                     gGadgetsOn,
  54.                                     gDisableAll;
  55. EXPORT struct List            gDefaultList;
  56. EXPORT struct Remember        *gRemKey;
  57. EXPORT struct Region            *gClipRegion;
  58. EXPORT USHORT                    gNextItemNum;
  59. EXPORT TextFont                *gFont;
  60. EXPORT struct FileRequester    *gFileRequest;
  61.  
  62. #ifdef MAIN                /*    these are globals that need to be initialized    */
  63.  
  64.     char    gWindTitle[] = "No Title";
  65.  
  66.     char *gDefaultMX[] = { "Oranges", "Apples", "Peaches", 0L };
  67.     
  68.     char *gLabelText[] =
  69.     {
  70.         "January", "February", "March", "April", "May", "June", "July", "August", "September",
  71.         "October", "November", "December", 0L
  72.     };    
  73.  
  74.     char     *gObjName[] =
  75.     {    
  76.         "Rect", "Line", "Text", "Button", "String", "Palette",
  77.         "CheckBox", "ListView", "Cycle", "MX", "Scroller",
  78.         "Slider", "IText"
  79.     };
  80.             
  81.     char    *gPlaceText[] = { "Left", "Right", "Above", "Below", "In", 0L };
  82.  
  83.     struct NewMenu gNewMenu[] =
  84.     {
  85.         {    NM_TITLE,        "Project",            0,            0,                                    0,        0                },
  86.         {        NM_ITEM,     "About...",            "A",        0,                                    0,        About            },
  87.         {        NM_ITEM,     "Open...",            "O",        0,                                    0,        DoOpen        },
  88.         {        NM_ITEM,     "SaveAs...",        "S",        0,                                    0,        DoSaveAs        },
  89.         {        NM_ITEM,     "Write Items...",    "W",        0,                                    0,        WriteItems    },
  90.         {        NM_ITEM,     "Quit...",            "Q",        0,                                    0,        Quit            },
  91.         {    NM_TITLE,        "Objects",            0,            0,                                    0,        0                },
  92.         {        NM_ITEM,        "New Button",        0,            0,                                    0,        NewObj        },
  93.         {        NM_ITEM,        "New CheckBox",    0,            0,                                    0,        NewObj        },
  94.         {        NM_ITEM,        "New Cycle",        0,            0,                                    0,        NewObj        },
  95.         {        NM_ITEM,        "New MX",            0,            0,                                    0,        NewObj        },
  96.         {        NM_ITEM,        NM_BARLABEL,        0,            0,                                    0,        0L                },
  97.         {        NM_ITEM,        "New String",        0,            0,                                    0,        NewObj        },
  98.         {        NM_ITEM,        "New Text",            0,            0,                                    0,        NewObj        },
  99.         {        NM_ITEM,        "New IText",        0,            0,                                    0,        NewObj        },
  100.         {        NM_ITEM,        NM_BARLABEL,        0,            0,                                    0,        0L                },
  101.         {        NM_ITEM,        "New Slider",        0,            0,                                    0,        NewObj        },
  102.         {        NM_ITEM,        "New Scroller",    0,            0,                                    0,        NewObj        },
  103.         {        NM_ITEM,        "New ListView",    0,            0,                                    0,        NewObj        },
  104.         {        NM_ITEM,        NM_BARLABEL,        0,            0,                                    0,        0L                },
  105.         {        NM_ITEM,        "New Palette",        0,            0,                                    0,        NewObj        },
  106.         {        NM_ITEM,        NM_BARLABEL,        0,            0,                                    0,        0L                },
  107.         {        NM_ITEM,        "New Rectangle",    0,            0,                                    0,        NewObj        },
  108.         {        NM_ITEM,        "New Line",            0,            0,                                    0,        NewObj        },
  109.         {    NM_TITLE,        "Control",            0,            0,                                    0,        0                },
  110.         {        NM_ITEM,        "Edit Mode",         "E",        CHECKIT | CHECKED | MENUTOGGLE,0,DoEditMode    },
  111.         {        NM_ITEM,        "Disable All",        "D",        CHECKIT | MENUTOGGLE,        0,        DoDisable    },
  112.         {        NM_ITEM,        "Bring to Front",    "F",        0,                                    0,        DoBringFront},
  113.         {        NM_ITEM,        "Send to Back",    "B",        0,                                    0,        DoSendBack    },
  114.         {        NM_ITEM,        "Sizeable Window", "W",        CHECKIT | CHECKED | MENUTOGGLE,0,DoWindSize    },
  115.         {        NM_ITEM,        "PickLVString",    0,            0,                                    0,        PickLVString},
  116.         {    NM_END,                0,                    0,            0,                                    0,        0                }
  117.     };    
  118.       
  119.     struct TextAttr topaz8 =
  120.     {     
  121.         "topaz.font",            //  Name
  122.         8,                        //  YSize
  123.         0,                        //  Style
  124.         0,                        //  Flags
  125.     };
  126.     
  127.     struct TextAttr helv15 =
  128.     {     
  129.         "helvetica.font",        //  Name
  130.         15,                        //  YSize
  131.         0,                            //  Style
  132.         0,                            //  Flags
  133.     };
  134.     
  135. #else        /*        MAIN not defined        */
  136.  
  137.     extern char                    gWindTitle[];
  138.     extern char                 *gLabelText[],
  139.                                     *gDefaultMX[],
  140.                                     *gObjName[],
  141.                                     *gPlaceText[];
  142.     extern struct NewMenu     gNewMenu[];
  143.     extern struct TextAttr    topaz8,
  144.                                     helv15;
  145.  
  146. #endif     /*    MAIN    */
  147.     
  148.     
  149. #endif     /*        GLOBAL_H        */
  150.  
  151.