Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / boopsi / newobjecta.c
blobdbbea8694b4ec67d9e9bb338b8d85ebddaa82a67
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Create a new BOOPSI object
6 Lang: english
7 */
8 #include <exec/lists.h>
9 #include <intuition/classes.h>
10 #include <proto/exec.h>
11 #include <proto/alib.h>
12 #include <clib/intuition_protos.h>
14 #include "intern.h"
16 #undef SDEBUG
17 #define SDEBUG 0
18 #undef DEBUG
19 #define DEBUG 0
20 #include <aros/debug.h>
22 /*****************************************************************************
24 NAME */
25 #include <intuition/classusr.h>
26 #include <proto/boopsi.h>
28 AROS_LH3(APTR, NewObjectA,
30 /* SYNOPSIS */
31 AROS_LHA(struct IClass *, classPtr, A0),
32 AROS_LHA(UBYTE *, classID, A1),
33 AROS_LHA(struct TagItem *, tagList, A2),
35 /* LOCATION */
36 struct Library *, BOOPSIBase, 11, BOOPSI)
38 /* FUNCTION
39 Use this function to create BOOPSI objects (BOOPSI stands for
40 "Basic Object Oriented Programming System for Intuition).
42 You may specify a class either by it's name (if it's a public class)
43 or by a pointer to its definition (if it's a private class). If
44 classPtr is NULL, classID is used.
46 INPUTS
47 classPtr - Pointer to a private class (or a public class if you
48 happen to have a pointer to it)
49 classID - Name of a public class
50 tagList - Initial attributes. Read the documentation of the class
51 carefully to find out which attributes must be specified
52 here and which can.
54 RESULT
55 A BOOPSI object which can be manipulated with general functions and
56 which must be disposed with DisposeObject() later.
58 NOTES
59 This functions send OM_NEW to the dispatcher of the class.
61 EXAMPLE
63 BUGS
65 SEE ALSO
66 DisposeObject(), SetAttrs(), GetAttr(), MakeClass(),
67 "Basic Object-Oriented Programming System for Intuition" and
68 "boopsi Class Reference" Dokument.
70 INTERNALS
72 HISTORY
73 29-10-95 digulla automatically created from
74 intuition_lib.fd and clib/intuition_protos.h
76 *****************************************************************************/
78 AROS_LIBFUNC_INIT
79 AROS_LIBBASE_EXT_DECL(struct Library*,BOOPSIBase)
80 Object * object;
82 EnterFunc(bug("intuition::NewObjectA()\n"));
84 /* No classPtr ? */
85 if (!classPtr)
86 classPtr = FindClass (classID);
88 if (!classPtr)
89 return (NULL); /* Nothing found */
91 D(bug("classPtr: %p\n", classPtr));
93 /* Try to create a new object */
94 if ((object = (Object *) CoerceMethod (classPtr, (Object *)classPtr, OM_NEW,
95 tagList, NULL)))
96 classPtr->cl_ObjectCount ++;
98 ReturnPtr("intuition::NewObjectA()", Object *, object);
99 AROS_LIBFUNC_EXIT
100 } /* NewObjectA */