/*
  NList.mcc (c) Copyright 1996 by Gilles Masson
  Registered MUI class, Serial Number: 1d51                            0x9d510030 to 0x9d51009F
  *** use only YOUR OWN Serial Number for your public custom class ***
  NList_mcc.h
*/


/* MUI Prop and Scroller classes stuff which is still not in libraries/mui.h  (in MUI3.8) */
/* it gives to the prop object it's increment value */
#ifndef MUIA_Prop_DeltaFactor
#define MUIA_Prop_DeltaFactor 0x80427C5E
#endif


#ifndef MUI_NList_MCC_H
#define MUI_NList_MCC_H

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



#define MUIC_NList "NList.mcc"
#define NListObject MUI_NewObject(MUIC_NList


/* Attributes */

#define MUIA_NList_TypeSelect               0x9d510030 /* GM  is.  LONG              */
#define MUIA_NList_VertDeltaFactor          0x9d510031 /* GM  ..gn LONG              */
#define MUIA_NList_HorizDeltaFactor         0x9d510032 /* GM  ..gn LONG              */

#define MUIA_NList_Horiz_First              0x9d510033 /* GM  .sgn LONG              */
#define MUIA_NList_Horiz_Visible            0x9d510034 /* GM  ..gn LONG              */
#define MUIA_NList_Horiz_Entries            0x9d510035 /* GM  ..gn LONG              */

#define MUIA_NList_Prop_First               0x9d510036 /* GM  .sgn LONG              */
#define MUIA_NList_Prop_Visible             0x9d510037 /* GM  ..gn LONG              */
#define MUIA_NList_Prop_Entries             0x9d510038 /* GM  ..gn LONG              */

#define MUIA_NList_TitlePen                 0x9d510039 /* GM  isg  LONG              */
#define MUIA_NList_ListPen                  0x9d51003a /* GM  isg  LONG              */
#define MUIA_NList_SelectPen                0x9d51003b /* GM  isg  LONG              */
#define MUIA_NList_CursorPen                0x9d51003c /* GM  isg  LONG              */
#define MUIA_NList_UnselCurPen              0x9d51003d /* GM  isg  LONG              */

#define MUIA_NList_ListBackground           0x9d51003e /* GM  isg  LONG              */
#define MUIA_NList_TitleBackground          0x9d51003f /* GM  isg  LONG              */
#define MUIA_NList_SelectBackground         0x9d510040 /* GM  isg  LONG              */
#define MUIA_NList_CursorBackground         0x9d510041 /* GM  isg  LONG              */
#define MUIA_NList_UnselCurBackground       0x9d510042 /* GM  isg  LONG              */

#define MUIA_NList_MultiClick               0x9d510043 /* GM  ..gn LONG              */

#define MUIA_NList_DefaultObjectOnClick     0x9d510044 /* GM  is.  BOOL              */

#define MUIA_NList_ClickColumn              0x9d510045 /* GM  ..g  LONG              */
#define MUIA_NList_DefClickColumn           0x9d510046 /* GM  isg  LONG              */
#define MUIA_NList_DoubleClick              0x9d510047 /* GM  ..gn BOOL              */
#define MUIA_NList_DragType                 0x9d510048 /* GM  isg  LONG              */
#define MUIA_NList_Input                    0x9d510049 /* GM  isg  BOOL              */
#define MUIA_NList_MultiSelect              0x9d51004a /* GM  is.  LONG              */
#define MUIA_NList_SelectChange             0x9d51004b /* GM  ...n BOOL              */

#define MUIA_NList_Active                   0x9d51004c /* GM  isgn LONG              */
#define MUIA_NList_AdjustHeight             0x9d51004d /* GM  i..  BOOL              */
#define MUIA_NList_AdjustWidth              0x9d51004e /* GM  i..  BOOL              */
#define MUIA_NList_AutoVisible              0x9d51004f /* GM  isg  BOOL              */
#define MUIA_NList_CompareHook              0x9d510050 /* GM  is.  struct Hook *     */
#define MUIA_NList_ConstructHook            0x9d510051 /* GM  is.  struct Hook *     */
#define MUIA_NList_DestructHook             0x9d510052 /* GM  is.  struct Hook *     */
#define MUIA_NList_DisplayHook              0x9d510053 /* GM  is.  struct Hook *     */
#define MUIA_NList_DragSortable             0x9d510054 /* GM  isg  BOOL              */
#define MUIA_NList_DropMark                 0x9d510055 /* GM  ..g  LONG              */
#define MUIA_NList_Entries                  0x9d510056 /* GM  ..g  LONG              */
#define MUIA_NList_First                    0x9d510057 /* GM  isg  LONG              */
#define MUIA_NList_Format                   0x9d510058 /* GM  isg  STRPTR            */
#define MUIA_NList_InsertPosition           0x9d510059 /* GM  ..g  LONG              */
#define MUIA_NList_MinLineHeight            0x9d51005a /* GM  is.  LONG              */
#define MUIA_NList_MultiTestHook            0x9d51005b /* GM  is.  struct Hook *     */
#define MUIA_NList_Pool                     0x9d51005c /* GM  i..  APTR              */
#define MUIA_NList_PoolPuddleSize           0x9d51005d /* GM  i..  ULONG             */
#define MUIA_NList_PoolThreshSize           0x9d51005e /* GM  i..  ULONG             */
#define MUIA_NList_Quiet                    0x9d51005f /* GM  .s.  BOOL              */
#define MUIA_NList_ShowDropMarks            0x9d510060 /* GM  isg  BOOL              */
#define MUIA_NList_SourceArray              0x9d510061 /* GM  i..  APTR *            */
#define MUIA_NList_Title                    0x9d510062 /* GM  isg  char *            */
#define MUIA_NList_Visible                  0x9d510063 /* GM  ..g  LONG              */
#define MUIA_NList_CopyEntryToClipHook      0x9d510064 /* GM  is.  struct Hook *     */
#define MUIA_NList_KeepActive               0x9d510065 /* GM  .s.  Obj *             */
#define MUIA_NList_MakeActive               0x9d510066 /* GM  .s.  Obj *             */
#define MUIA_NList_SourceString             0x9d510067 /* GM  i..  char *            */
#define MUIA_NList_CopyColumnToClipHook     0x9d510068 /* GM  is.  struct Hook *     */
#define MUIA_NList_ListCompatibility        0x9d510069 /* GM  ...  OBSOLETE          */
#define MUIA_NList_AutoCopyToClip           0x9d51006A /* GM  is.  BOOL              */
#define MUIA_NList_TabSize                  0x9d51006B /* GM  isg  ULONG             */
#define MUIA_NList_SkipChars                0x9d51006C /* GM  isg  char *            */
#define MUIA_NList_DisplayRecall            0x9d51006D /* GM  .g.  BOOL              */
#define MUIA_NList_PrivateData              0x9d51006E /* GM  isg  APTR              */
#define MUIA_NList_EntryValueDependent      0x9d51006F /* GM  isg  BOOL              */

#define MUIA_NList_DragColumnOnly           0x9d51009A /* GM  isg  LONG              */
#define MUIA_NList_TitleClick               0x9d51009B /* GM  isgn LONG              */
#define MUIA_NList_DropType                 0x9d51009C /* GM  ..g  LONG              */
#define MUIA_NList_ForcePen                 0x9d51009D /* GM  isg  LONG              */
#define MUIA_NList_SourceInsert             0x9d51009E /* GM  i..  struct MUIP_NList_InsertWrap *   */
#define MUIA_NList_TitleSeparator           0x9d51009F /* GM  isg  BOOL              */

#define MUIA_NLIMG_EntryCurrent             MUIA_NList_First   /* LONG (special for image object) */
#define MUIA_NLIMG_EntryHeight              MUIA_NList_Visible /* LONG (special for image object) */



/* Attributes special datas */

#define MUIV_NList_TypeSelect_Line        0
#define MUIV_NList_TypeSelect_Char        1

#define MUIV_NList_Font                 -20
#define MUIV_NList_Font_Little          -21
#define MUIV_NList_Font_Fixed           -22

#define MUIV_NList_ConstructHook_String  -1
#define MUIV_NList_DestructHook_String   -1

#define MUIV_NList_Active_Off            -1
#define MUIV_NList_Active_Top            -2
#define MUIV_NList_Active_Bottom         -3
#define MUIV_NList_Active_Up             -4
#define MUIV_NList_Active_Down           -5
#define MUIV_NList_Active_PageUp         -6
#define MUIV_NList_Active_PageDown       -7

#define MUIV_NList_First_Top             -2
#define MUIV_NList_First_Bottom          -3
#define MUIV_NList_First_Up              -4
#define MUIV_NList_First_Down            -5
#define MUIV_NList_First_PageUp          -6
#define MUIV_NList_First_PageDown        -7
#define MUIV_NList_First_Up2             -8
#define MUIV_NList_First_Down2           -9
#define MUIV_NList_First_Up4            -10
#define MUIV_NList_First_Down4          -11

#define MUIV_NList_Horiz_First_Start     -2
#define MUIV_NList_Horiz_First_End       -3
#define MUIV_NList_Horiz_First_Left      -4
#define MUIV_NList_Horiz_First_Right     -5
#define MUIV_NList_Horiz_First_PageLeft  -6
#define MUIV_NList_Horiz_First_PageRight -7
#define MUIV_NList_Horiz_First_Left2     -8
#define MUIV_NList_Horiz_First_Right2    -9
#define MUIV_NList_Horiz_First_Left4    -10
#define MUIV_NList_Horiz_First_Right4   -11

#define MUIV_NList_MultiSelect_None       0
#define MUIV_NList_MultiSelect_Default    1
#define MUIV_NList_MultiSelect_Shifted    2
#define MUIV_NList_MultiSelect_Always     3

#define MUIV_NList_Insert_Top             0
#define MUIV_NList_Insert_Active         -1
#define MUIV_NList_Insert_Sorted         -2
#define MUIV_NList_Insert_Bottom         -3

#define MUIV_NList_Remove_First           0
#define MUIV_NList_Remove_Active         -1
#define MUIV_NList_Remove_Last           -2
#define MUIV_NList_Remove_Selected       -3

#define MUIV_NList_Select_Off             0
#define MUIV_NList_Select_On              1
#define MUIV_NList_Select_Toggle          2
#define MUIV_NList_Select_Ask             3

#define MUIV_NList_GetEntry_Active       -1
#define MUIV_NList_GetEntryInfo_Line     -2

#define MUIV_NList_Select_Active         -1
#define MUIV_NList_Select_All            -2

#define MUIV_NList_Redraw_Active         -1
#define MUIV_NList_Redraw_All            -2

#define MUIV_NList_Move_Top               0
#define MUIV_NList_Move_Active           -1
#define MUIV_NList_Move_Bottom           -2
#define MUIV_NList_Move_Next             -3 /* only valid for second parameter (and not with Move_Selected) */
#define MUIV_NList_Move_Previous         -4 /* only valid for second parameter (and not with Move_Selected) */
#define MUIV_NList_Move_Selected         -5 /* only valid for first parameter */

#define MUIV_NList_Exchange_Top           0
#define MUIV_NList_Exchange_Active       -1
#define MUIV_NList_Exchange_Bottom       -2
#define MUIV_NList_Exchange_Next         -3 /* only valid for second parameter */
#define MUIV_NList_Exchange_Previous     -4 /* only valid for second parameter */

#define MUIV_NList_Jump_Top               0
#define MUIV_NList_Jump_Active           -1
#define MUIV_NList_Jump_Bottom           -2
#define MUIV_NList_Jump_Up               -4
#define MUIV_NList_Jump_Down             -3

#define MUIV_NList_NextSelected_Start    -1
#define MUIV_NList_NextSelected_End      -1

#define MUIV_NList_DragType_None          0
#define MUIV_NList_DragType_Default       1
#define MUIV_NList_DragType_Immediate     2
#define MUIV_NList_DragType_Borders       3
#define MUIV_NList_DragType_Qualifier     4

#define MUIV_NList_CopyToClip_Active     -1
#define MUIV_NList_CopyToClip_Selected   -2
#define MUIV_NList_CopyToClip_All        -3
#define MUIV_NList_CopyToClip_Entries    -4
#define MUIV_NList_CopyToClip_Entry      -5
#define MUIV_NList_CopyToClip_Strings    -6
#define MUIV_NList_CopyToClip_String     -7

#define MUIV_NList_CopyTo_Active         -1
#define MUIV_NList_CopyTo_Selected       -2
#define MUIV_NList_CopyTo_All            -3
#define MUIV_NList_CopyTo_Entries        -4
#define MUIV_NList_CopyTo_Entry          -5

#define MUIV_NLCT_Success                 0
#define MUIV_NLCT_OpenErr                 1
#define MUIV_NLCT_WriteErr                2
#define MUIV_NLCT_Failed                  3

#define MUIV_NList_ForcePen_On            1
#define MUIV_NList_ForcePen_Off           0
#define MUIV_NList_ForcePen_Default      -1

#define MUIV_NList_DropType_Mask          0x00FF
#define MUIV_NList_DropType_None          0
#define MUIV_NList_DropType_Above         1
#define MUIV_NList_DropType_Below         2
#define MUIV_NList_DropType_Onto          3


/* Structs */

struct BitMapImage
{
  ULONG    control;   /* should be == to MUIM_NList_CreateImage for a valid BitMapImage struct */
  WORD     width;     /* if control == MUIA_Image_Spec then obtainpens is a pointer to an Object */
  WORD     height;
  WORD    *obtainpens;
  PLANEPTR mask;
  struct BitMap imgbmp;
};


struct MUI_NList_TestPos_Result
{
  LONG  entry;   /* number of entry, -1 if mouse not over valid entry */
  WORD  column;  /* numer of column, -1 if no valid column */
  UWORD flags;   /* not in the list, see below */
  WORD  xoffset; /* x offset in column */
  WORD  yoffset; /* y offset of mouse click from center of line */
  WORD  preparse;     /* 2 if in column preparse string, 1 if in entry preparse string, else 0 */
  WORD  char_number;  /* the number of the clicked char in column, -1 if no valid */
  WORD  char_xoffset; /* x offset of mouse clicked from left of char if positive */
};                    /* and left of next char if negative. If there is no char there */
                      /* negative if from left of first char else from right of last one */

#define MUI_NLPR_ABOVE  (1<<0)
#define MUI_NLPR_BELOW  (1<<1)
#define MUI_NLPR_LEFT   (1<<2)
#define MUI_NLPR_RIGHT  (1<<3)
#define MUI_NLPR_BAR    (1<<4)  /* if between two columns you'll get the left
                                   column number of both, and that flag */
#define MUI_NLPR_TITLE  (1<<5)  /* if clicked on title, only column, xoffset and yoffset (and MUI_NLPR_BAR)
                                    are valid (you'll get MUI_NLPR_ABOVE too) */


struct MUI_NList_GetEntryInfo
{
  LONG pos;             /* num of entry you want info about */
  LONG line;            /* real line number */
  LONG entry_pos;       /* entry num of returned entry ptr */
  APTR entry;           /* entry pointer */
  LONG wrapcol;         /* NOWRAP, WRAPCOLx, or WRAPPED|WRAPCOLx */
  LONG charpos;         /* start char number in string (unused if NOWRAP) */
  LONG charlen;         /* string lenght (unused if NOWRAP) */
};

#define NOWRAP          0x00
#define WRAPCOL0        0x01
#define WRAPCOL1        0x02
#define WRAPCOL2        0x04
#define WRAPCOL3        0x08
#define WRAPCOL4        0x10
#define WRAPCOL5        0x20
#define WRAPCOL6        0x40
#define WRAPPED         0x80


struct MUI_NList_GetSelectInfo
{
  LONG start;        /* num of first selected *REAL* entry/line (first of wrapped from which start is issued) */
  LONG end;          /* num of last selected *REAL* entry/line (first of wrapped from which start is issued) */
  LONG num;          /* not used */
  LONG start_col;    /* column of start of selection in 'start' entry */
  LONG end_col;      /* column of end of selection in 'end' entry */
  LONG start_pos;    /* char pos of start of selection in 'start_col' entry */
  LONG end_pos;      /* char pos of end of selection in 'end_col' entry */
  LONG vstart;       /* num of first visually selected entry */
  LONG vend;         /* num of last visually selected entry */
  LONG vnum;         /* number of visually selected entries */
};
/* NOTE that vstart==start, vend==end in all cases if no wrapping is used */

/* Methods */

#define MUIM_NList_Clear              0x9d510070 /* GM */
#define MUIM_NList_CreateImage        0x9d510071 /* GM */
#define MUIM_NList_DeleteImage        0x9d510072 /* GM */
#define MUIM_NList_Exchange           0x9d510073 /* GM */
#define MUIM_NList_GetEntry           0x9d510074 /* GM */
#define MUIM_NList_Insert             0x9d510075 /* GM */
#define MUIM_NList_InsertSingle       0x9d510076 /* GM */
#define MUIM_NList_Jump               0x9d510077 /* GM */
#define MUIM_NList_Move               0x9d510078 /* GM */
#define MUIM_NList_NextSelected       0x9d510079 /* GM */
#define MUIM_NList_Redraw             0x9d51007a /* GM */
#define MUIM_NList_Remove             0x9d51007b /* GM */
#define MUIM_NList_Select             0x9d51007c /* GM */
#define MUIM_NList_Sort               0x9d51007d /* GM */
#define MUIM_NList_TestPos            0x9d51007e /* GM */
#define MUIM_NList_CopyToClip         0x9d51007f /* GM */
#define MUIM_NList_UseImage           0x9d510080 /* GM */
#define MUIM_NList_ReplaceSingle      0x9d510081 /* GM */
#define MUIM_NList_InsertWrap         0x9d510082 /* GM */
#define MUIM_NList_InsertSingleWrap   0x9d510083 /* GM */
#define MUIM_NList_GetEntryInfo       0x9d510084 /* GM */
#define MUIM_NList_QueryBeginning     0x9d510085 /* Obsolete */
#define MUIM_NList_GetSelectInfo      0x9d510086 /* GM */
#define MUIM_NList_CopyTo             0x9d510087 /* GM */
#define MUIM_NList_DropType           0x9d510088 /* GM */
#define MUIM_NList_DropDraw           0x9d510089 /* GM */
struct  MUIP_NList_Clear              { ULONG MethodID; };
struct  MUIP_NList_CreateImage        { ULONG MethodID; Object *obj; ULONG flags; };
struct  MUIP_NList_DeleteImage        { ULONG MethodID; APTR listimg; };
struct  MUIP_NList_Exchange           { ULONG MethodID; LONG pos1; LONG pos2; };
struct  MUIP_NList_GetEntry           { ULONG MethodID; LONG pos; APTR *entry; };
struct  MUIP_NList_Insert             { ULONG MethodID; APTR *entries; LONG count; LONG pos; };
struct  MUIP_NList_InsertSingle       { ULONG MethodID; APTR entry; LONG pos; };
struct  MUIP_NList_Jump               { ULONG MethodID; LONG pos; };
struct  MUIP_NList_Move               { ULONG MethodID; LONG from; LONG to; };
struct  MUIP_NList_NextSelected       { ULONG MethodID; LONG *pos; };
struct  MUIP_NList_Redraw             { ULONG MethodID; LONG pos; };
struct  MUIP_NList_Remove             { ULONG MethodID; LONG pos; };
struct  MUIP_NList_Select             { ULONG MethodID; LONG pos; LONG seltype; LONG *state; };
struct  MUIP_NList_Sort               { ULONG MethodID; };
struct  MUIP_NList_TestPos            { ULONG MethodID; LONG x; LONG y; struct MUI_NList_TestPos_Result *res; };
struct  MUIP_NList_CopyToClip         { ULONG MethodID; LONG pos; ULONG clipnum; APTR *entries; struct Hook *hook; };
struct  MUIP_NList_UseImage           { ULONG MethodID; Object *obj; LONG imgnum; ULONG flags; };
struct  MUIP_NList_ReplaceSingle      { ULONG MethodID; APTR entry; LONG pos; LONG wrapcol; LONG align; };
struct  MUIP_NList_InsertWrap         { ULONG MethodID; APTR *entries; LONG count; LONG pos; LONG wrapcol; LONG align; };
struct  MUIP_NList_InsertSingleWrap   { ULONG MethodID; APTR entry; LONG pos; LONG wrapcol; LONG align; };
struct  MUIP_NList_GetEntryInfo       { ULONG MethodID; struct MUI_NList_GetEntryInfo *res; };
struct  MUIP_NList_QueryBeginning     { ULONG MethodID; };
struct  MUIP_NList_GetSelectInfo      { ULONG MethodID; struct MUI_NList_GetSelectInfo *res; };
struct  MUIP_NList_CopyTo             { ULONG MethodID; LONG pos; char *filename; APTR *result; APTR *entries; };
struct  MUIP_NList_DropType           { ULONG MethodID; LONG *pos; LONG *type; LONG minx, maxx, miny, maxy; LONG mousex, mousey; };
struct  MUIP_NList_DropDraw           { ULONG MethodID; LONG pos; LONG type; LONG minx, maxx, miny, maxy; };

#define DISPLAY_ARRAY_MAX 64

#define ALIGN_LEFT      0x0000
#define ALIGN_CENTER    0x0100
#define ALIGN_RIGHT     0x0200
#define ALIGN_JUSTIFY   0x0400


#endif /* MUI_NList_MCC_H */

