a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Libraries:
 intuition.library
  ActivateGadget
  ActivateWindow
  AddClass
  AddGList
  AddGadget
  AllocRemember
  AllocScreenBuffer
  AutoRequest
  BeginRefresh
  BuildEasyRequestArgs
  BuildSysRequest
  ChangeScreenBuffer
  ChangeWindowBox
  ClearDMRequest
  ClearMenuStrip
  ClearPointer
  CloseScreen
  CloseWindow
  CloseWorkBench
  CurrentTime
  DisplayAlert
  DisplayBeep
  DisposeObject
  DoGadgetMethodA
  DoubleClick
  DrawBorder
  DrawImage
  DrawImageState
  EasyRequestArgs
  EndRefresh
  EndRequest
  EraseImage
  FreeClass
  FreeRemember
  FreeScreenBuffer
  FreeScreenDrawInfo
  FreeSysRequest
  GadgetMouse
  GetAttr
  GetDefPrefs
  GetDefaultPubScreen
  GetPrefs
  GetScreenData
  GetScreenDrawInfo
  HelpControl
  InitRequester
  IntuiTextLength
  ItemAddress
  LendMenus
  LockIBase
  LockPubScreen
  LockPubScreenList
  MakeClass
  MakeScreen
  ModifyIDCMP
  ModifyProp
  MoveScreen
  MoveWindow
  MoveWindowInFrontOf
  NewModifyProp
  NewObject
  NextObject
  NextPubScreen
  ObtainGIRPort
  OffGadget
  OffMenu
  OnGadget
  OnMenu
  OpenScreen
  OpenScreenTagList
  OpenWindow
  OpenWindowTagList
  OpenWorkBench
  PointInImage
  PrintIText
  PubScreenStatus
  QueryOverscan
  RefreshGList
  RefreshGadgets
  RefreshWindowFrame
  ReleaseGIRPort
  RemakeDisplay
  RemoveClass
  RemoveGList
  RemoveGadget
  ReportMouse
  Request
  ResetMenuStrip
  RethinkDisplay
  ScreenDepth
  ScreenPosition
  ScreenToBack
  ScreenToFront
  ScrollWindowRaster
  SetAttrsA
  SetDMRequest
  SetDefaultPubScreen
  SetEditHook
  SetGadgetAttrsA
  SetMenuStrip
  SetMouseQueue
  SetPointer
  SetPrefs
  SetPubScreenModes
  SetWindowPointerA
  SetWindowTitles
  ShowTitle
  SizeWindow
  SysReqHandler
  TimedDisplayAlert
  UnlockIBase
  UnlockPubScreen
  UnlockPubScreenList
  ViewAddress
  ViewPortAddress
  WBenchToBack
  WBenchToFront
  WindowLimits
  WindowToBack
  WindowToFront
  ZipWindow
Include
GuruMeditation
Docs » Autodocs » intuition.library » MakeClass

NAME

	MakeClass -- Create and initialize a boopsi class. (V36)

SYNOPSIS

	iclass = MakeClass( ClassID, SuperClassID, SuperClassPtr,
D0 A0 A1 A2
InstanceSize, Flags )
D0 D1
struct IClass *MakeClass( UBYTE *, UBYTE *, struct IClass *,
UWORD, ULONG );

FUNCTION

	For class implementors only.
This function creates a new public or private boopsi class.
The superclass should be defined to be another boopsi class:
all classes are descendants of the class "rootclass".
Superclasses can be public or private. You provide a name/ID
for your class if it is to be a public class (but you must
have registered your class name and your attribute ID's with
Commodore before you do this!). For a public class, you would
also call AddClass() to make it available after you have
finished your initialization.
Returns pointer to an IClass data structure for your
class. You then initialize the Hook cl_Dispatcher for
your class methods code. You can also set up special data
shared by all objects in your class, and point cl_UserData at it.
The last step for public classes is to call AddClass().
You dispose of a class created by this function by calling
FreeClass().

INPUTS

	ClassID = NULL for private classes, the name/ID string for public
classes
SuperClassID = name/ID of your new class's superclass. NULL if
superclass is a private class
SuperClassPtr = pointer to private superclass. Only used if
SuperClassID is NULL. You are required never to provide
a NULL superclass.
InstanceSize = the size of the instance data that your class's
objects will require, beyond that data defined for
your superclass's objects.
Flags = for future enhancement, including possible additional
parameters. Provide zero for now.

RESULT

	Pointer to the resulting class, or NULL if not possible:
- no memory for class data structure
- public superclass not found
- public class of same name/ID as this one already exists

NOTES

EXAMPLE

	Creating a private subclass of a public class:
/* per-object instance data defined by my class */
struct MyInstanceData {
ULONG mid_SomeData;
};
/* some useful table I'll share use for all objects */
UWORD myTable[] = {
5, 4, 3, 2, 1, 0
};
struct IClass *
initMyClass()
{
ULONG __saveds myDispatcher();
ULONG hookEntry(); /* asm-to-C interface glue */
struct IClass *cl;
struct IClass *MakeClass();
if ( cl = MakeClass( NULL,
SUPERCLASSID, NULL, /* superclass is public */
sizeof (struct MyInstanceData),
0 ))
{
/* initialize the cl_Dispatcher Hook */
cl->cl_Dispatcher.h_Entry = hookEntry;
cl->cl_Dispatcher.h_SubEntry = myDispatcher;
cl->cl_Dispatcher.h_Data = (VOID *) 0xFACE; /* unused */
cl-cl_UserData = (ULONG) myTable;
}
return ( cl );
}

BUGS

	The typedef 'Class' isn't consistently used.  Class pointers
used blindly should be APTR, or struct IClass for class implementors.

SEE ALSO

FreeClass(), AddClass(), RemoveClass(), NewObject(), Document "Basic Object-Oriented Programming System for Intuition", and the "boopsi Class Reference" document.

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

Kefrens

SPB
KEF
RZR
AOA

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se