grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / classes / zune / nlist / nlist_mcc / NList_img.c
blob7414f37d3648097fbf8b3cc5564216034b3bd4d7
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
22 $Id$
24 ***************************************************************************/
26 #include <clib/alib_protos.h>
27 #include <proto/muimaster.h>
28 #include <proto/utility.h>
29 #include <proto/intuition.h>
31 #include "private.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);
40 if (data->DoDraw)
41 DoSuperMethodA(cl,obj,(Msg) msg);
43 return(0);
47 static IPTR mNLI_New(struct IClass *cl,Object *obj,struct opSet *msg)
49 struct NLIData *data;
51 if (!(obj = (Object *)DoSuperMethodA(cl,obj,(Msg) msg)))
52 return(0);
54 data = INST_DATA(cl,obj);
55 data->DoDraw = FALSE;
57 return((IPTR) 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));)
68 switch (tag->ti_Tag)
70 case MUIA_Image_Spec:
71 tag->ti_Tag = TAG_IGNORE;
72 data->DoDraw = TRUE;
73 MUI_Redraw(obj,MADF_DRAWOBJECT);
74 data->DoDraw = FALSE;
75 break;
76 case MUIA_FillArea:
77 case MUIA_Font:
78 case MUIA_Background:
79 tag->ti_Tag = TAG_IGNORE;
80 break;
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));
101 return (NLI_Class);
105 void NLI_Delete(void)
107 if (NLI_Class)
108 MUI_DeleteCustomClass(NLI_Class);
109 NLI_Class = NULL;