/*
**
** $VER: Toolbar_mcc.h V15.5
** Copyright © 1997-98 Benny Kjær Nielsen. All rights reserved.
**
*/

/*** Include stuff ***/

#ifndef TOOLBAR_MCC_H
#define TOOLBAR_MCC_H

#ifndef LIBRARIES_MUI_H
#include <libraries/mui.h>
#endif

#ifndef   EXEC_TYPES_H
#include <exec/types.h>
#endif

#define SERIAL (31991<<16)

/*** MUI Defines ***/

#define MUIC_Toolbar "Toolbar.mcc"
#define ToolbarObject MUI_NewObject(MUIC_Toolbar

/*** Methods ***/

#define MUIM_Toolbar_BottomEdge      (TAG_USER | SERIAL | 0x0007 )
#define MUIM_Toolbar_KillNotify      (TAG_USER | SERIAL | 0x0002 )
#define MUIM_Toolbar_KillNotifyObj   (TAG_USER | SERIAL | 0x0003 )
#define MUIM_Toolbar_LeftEdge        (TAG_USER | SERIAL | 0x0008 )
#define MUIM_Toolbar_MultiSet        (TAG_USER | SERIAL | 0x0004 )
#define MUIM_Toolbar_Notify          (TAG_USER | SERIAL | 0x0001 )
#define MUIM_Toolbar_Redraw          (TAG_USER | SERIAL | 0x0005 )
#define MUIM_Toolbar_ReloadImages    (TAG_USER | SERIAL | 0x000B )
#define MUIM_Toolbar_RightEdge       (TAG_USER | SERIAL | 0x0009 )
#define MUIM_Toolbar_Set             (TAG_USER | SERIAL | 0x0006 )
#define MUIM_Toolbar_TopEdge         (TAG_USER | SERIAL | 0x000A )

/*** Method structs ***/

struct MUIP_Toolbar_Edge             {ULONG MethodID; ULONG Button; };
struct MUIP_Toolbar_KillNotify       {ULONG MethodID; ULONG TrigButton; ULONG TrigAttr; };
struct MUIP_Toolbar_KillNotifyObj    {ULONG MethodID; };
struct MUIP_Toolbar_MultiSet         {ULONG MethodID; ULONG Flag; ULONG Value; ULONG Button; /* ... */ };
struct MUIP_Toolbar_Notify           {ULONG MethodID; ULONG TrigButton; ULONG TrigAttr; ULONG TrigValue; APTR DestObj; ULONG FollowParams; /* ... */};
struct MUIP_Toolbar_Redraw           {ULONG MethodID; ULONG Changes; };
struct MUIP_Toolbar_ReloadImages     {ULONG MethodID; STRPTR Normal; STRPTR Select; STRPTR Ghost; };
struct MUIP_Toolbar_Set              {ULONG MethodID; ULONG Button; ULONG Flag; ULONG Value; };

/*** Special method values ***/

#define MUIV_Toolbar_Set_Ghosted     0x0000004
#define MUIV_Toolbar_Set_Gone        0x0000008
#define MUIV_Toolbar_Set_Selected    0x0000010

#define MUIV_Toolbar_Notify_Pressed    0x0000000
#define MUIV_Toolbar_Notify_Active     0x0000001
#define MUIV_Toolbar_Notify_Ghosted    0x0000002
#define MUIV_Toolbar_Notify_Gone       0x0000003
#define MUIV_Toolbar_Notify_LeftEdge   0x0000004
#define MUIV_Toolbar_Notify_RightEdge  0x0000005
#define MUIV_Toolbar_Notify_TopEdge    0x0000006
#define MUIV_Toolbar_Notify_BottomEdge 0x0000007

/*** Special method flags ***/

/*** Attributes ***/

#define MUIA_Toolbar_Description     (TAG_USER | SERIAL | 0x0016 )
#define MUIA_Toolbar_HelpString      (TAG_USER | SERIAL | 0x0017 )
#define MUIA_Toolbar_Horizontal      (TAG_USER | SERIAL | 0x0015 )
#define MUIA_Toolbar_ImageGhost      (TAG_USER | SERIAL | 0x0013 )
#define MUIA_Toolbar_ImageNormal     (TAG_USER | SERIAL | 0x0011 )
#define MUIA_Toolbar_ImageSelect     (TAG_USER | SERIAL | 0x0012 )
#define MUIA_Toolbar_ImageType       (TAG_USER | SERIAL | 0x0010 )
#define MUIA_Toolbar_ParseUnderscore (TAG_USER | SERIAL | 0x0018 )
#define MUIA_Toolbar_Permutation     (TAG_USER | SERIAL | 0x001A )
#define MUIA_Toolbar_Reusable        (TAG_USER | SERIAL | 0x0019 )

/*** Special attribute values ***/

#define MUIV_Toolbar_ImageType_File     0
#define MUIV_Toolbar_ImageType_Memory   1
#define MUIV_Toolbar_ImageType_Object   2

/*** Structures, Flags & Values ***/

struct MUIP_Toolbar_Description
{
  UBYTE   Type;          /* Type of button - see possible values below (TDT_). */
  UBYTE   Key;           /* Hotkey */
  UWORD   Flags;         /* The buttons current setting - see the TDF_ flags */
  STRPTR  ToolText;      /* The text beneath the icons. */
  STRPTR  HelpString;    /* The string used for help-bubbles or MUIA_Toolbar_HelpString */
  ULONG   MutualExclude; /* Buttons to be released when this button is pressed down */
};

/*** Toolbar Description Types ***/

#define TDT_BUTTON  0
#define TDT_SPACE   1
#define TDT_IGNORE  2 // Obsolete
#define TDT_END     3

#define TDT_IGNORE_FLAG 128

/*** Toolbar Description Flags ***/

#define TDF_TOGGLE      0x0000001 /* Set this if it's a toggle-button */
#define TDF_RADIO       0x0000002 /* AND this if it's also a radio-button */
#define TDF_GHOSTED     0x0000004
#define TDF_GONE        0x0000008 /* Make the button temporarily go away */
#define TDF_SELECTED    0x0000010 /* State of a toggle-button */

#define TDF_RADIOTOGGLE (TDF_TOGGLE|TDF_RADIO) /* A practical definition */

/* TDF_RADIO and TDF_SELECTED only makes sense
   if you have set the TDF_TOGGLE flag.          */

/*** Toolbar Macros ***/

#define Toolbar_Button(flags, text)          { TDT_BUTTON, NULL, flags, text, NULL, NULL}
#define Toolbar_KeyButton(flags, text, key)  { TDT_BUTTON, key,  flags, text, NULL, NULL}
#define Toolbar_Space                        { TDT_SPACE,  NULL, NULL,  NULL, NULL, NULL}
#define Toolbar_End                          { TDT_END,    NULL, NULL,  NULL, NULL, NULL}

#endif /* TOOLBAR_MCC_H */
