Adapted to recent changes of %build_linklib.
[AROS-Contrib.git] / FryingPan / framework / Generic / MUICustomClass.h
blob8cce683ec1bc45ede97b765727b74a70bd170e42
1 /*
2 * Amiga Generic Set - set of libraries and includes to ease sw development for all Amiga platforms
3 * Copyright (C) 2001-2011 Tomasz Wiszkowski Tomasz.Wiszkowski at gmail.com.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _GENERIC_MUICUSTOMCLASS_H_
21 #define _GENERIC_MUICUSTOMCLASS_H_
23 #include "GenericMUI.h"
24 #include "HookT.h"
25 #include <intuition/classusr.h>
26 #include "Registers.h"
27 #include "LibrarySpool.h"
28 #include <stdarg.h>
29 #include <libclass/intuition.h>
30 #include <libraries/mui.h>
34 * HOW TO USE IT?
35 * it is best to create the object that derives from the GenericOOP class
36 * simply replace DoMtd() with your own method to get the desired effect
39 namespace GenNS
41 class MUICustomClass : public GenericMUI
43 protected:
44 virtual GenericOOP *createObject(IClass *cls) = 0;
46 private:
47 void *getDispatcher();
48 virtual unsigned long dispatch(IClass *cls, Object* obj, unsigned long *msg);
50 protected:
51 MUI_CustomClass *pMUIClass;
52 IClass *pClass;
54 public:
55 MUICustomClass(const char *parent);
56 virtual ~MUICustomClass();
57 Object *Create(unsigned long lTag1, ...);
59 private:
60 #if defined (__AROS__)
61 AROS_UFP4(static IPTR, FDispatchCaller,
62 AROS_UFPA(struct IClass *, pClass, A0),
63 AROS_UFPA(Object *, pObject, A2),
64 AROS_UFPA(unsigned long *, pMessage, A1),
65 AROS_UFPA(APTR, data, A6));
66 #elif defined (__AMIGAOS4__)
67 static unsigned long FDispatchCaller(IClass *pClass, Object* pObject, unsigned long *pMessage);
68 #elif defined (__MORPHOS__)
69 static unsigned long FDispatchCallerFunc();
70 static const unsigned long FDispatchCaller[2];
71 #elif defined (__mc68000)
72 static unsigned long FDispatchCaller();
73 #endif
77 #endif