1 /***************************************************************************
3 NList.mcc - New List MUI Custom Class
4 Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0
5 0x9d5100C0 to 0x9d5100FF
7 Copyright (C) 1996-2001 by Gilles Masson
8 Copyright (C) 2001-2014 NList Open Source Team
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 NList classes Support Site: http://www.sf.net/projects/nlist-classes
24 ***************************************************************************/
26 #include <clib/alib_protos.h>
27 #include <proto/muimaster.h>
28 #include <proto/utility.h>
29 #include <proto/intuition.h>
33 #include "NList_img.h"
35 struct MUI_CustomClass
*NLI_Class
= NULL
;
37 static IPTR
mNLI_Draw(struct IClass
*cl
,Object
*obj
,struct MUIP_Draw
*msg
)
39 struct NLIData
*data
= INST_DATA(cl
,obj
);
41 DoSuperMethodA(cl
,obj
,(Msg
) msg
);
47 static IPTR
mNLI_New(struct IClass
*cl
,Object
*obj
,struct opSet
*msg
)
51 if (!(obj
= (Object
*)DoSuperMethodA(cl
,obj
,(Msg
) msg
)))
54 data
= INST_DATA(cl
,obj
);
61 static IPTR
mNLI_Set(struct IClass
*cl
,Object
*obj
,Msg msg
)
63 struct NLIData
*data
= INST_DATA(cl
,obj
);
64 struct TagItem
*tags
,*tag
;
66 for(tags
=((struct opSet
*)msg
)->ops_AttrList
;(tag
=(struct TagItem
*) NextTagItem((APTR
)&tags
));)
71 tag
->ti_Tag
= TAG_IGNORE
;
73 MUI_Redraw(obj
,MADF_DRAWOBJECT
);
79 tag
->ti_Tag
= TAG_IGNORE
;
83 return (DoSuperMethodA(cl
,obj
,msg
));
86 DISPATCHER(NLI_Dispatcher
)
88 switch (msg
->MethodID
)
90 case OM_NEW
: return ( mNLI_New(cl
,obj
,(APTR
)msg
));
91 case MUIM_HandleInput
: return (0);
92 case OM_SET
: return ( mNLI_Set(cl
,obj
,(APTR
)msg
));
93 case MUIM_Draw
: return ( mNLI_Draw(cl
,obj
,(APTR
)msg
));
95 return(DoSuperMethodA(cl
,obj
,msg
));
98 struct MUI_CustomClass
*NLI_Create(void)
100 NLI_Class
= MUI_CreateCustomClass(NULL
, (STRPTR
)MUIC_Image
, NULL
, sizeof(struct NLIData
), ENTRY(NLI_Dispatcher
));
105 void NLI_Delete(void)
108 MUI_DeleteCustomClass(NLI_Class
);