amiga-bootcamp/09_intuition/boopsi.md
Ilia Sharin 21751c0025 docs(amiga): complete AmigaOS 3.1/3.2 developer reference — 172 files across 17 sections
Comprehensive technical documentation covering:
- Hardware: OCS/ECS/AGA custom chip registers, Copper & Blitter deep dives
- Boot sequence: cold boot through startup-sequence
- Binary format: HUNK executable spec, relocation, debug info
- Linking & ABI: .fd files, LVO tables, register calling conventions
- Exec kernel: tasks, interrupts, memory, signals, semaphores
- AmigaDOS: file I/O, FFS/OFS layout, CLI/Shell scripting
- Graphics: planar bitmaps, Copper programming, HAM/EHB modes
- Intuition: screens, windows, IDCMP, BOOPSI
- Devices: trackdisk, SCSI, serial, timer, audio, keyboard
- Libraries: utility, expansion, IFFParse, locale, ARexx
- Networking: bsdsocket API, SANA-II, TCP/IP stack comparison
- Toolchain: GCC, vasm/vlink, SAS/C, NDK, debugging
- Reverse engineering: IDA/Ghidra setup, compiler fingerprints, case studies
- CPU & MMU: 68040/060 emulation libs, PMMU, cache management
- Driver development: SANA-II, Picasso96/RTG, AHI audio

All files include breadcrumb navigation. No local paths or proprietary content.
2026-04-23 12:17:35 -04:00

2.6 KiB

← Home · Intuition

BOOPSI — Basic Object-Oriented Programming System

Overview

BOOPSI is AmigaOS's class-based object system for Intuition gadgets and images. Objects receive messages via DoMethod() and support inheritance and notification.


Core Methods

Method Description
OM_NEW Create new object
OM_DISPOSE Destroy object
OM_SET Set attributes
OM_GET Get attributes
OM_UPDATE Attribute changed notification
OM_NOTIFY Send notification to targets
GM_RENDER Render the gadget
GM_GOACTIVE Gadget activated by user
GM_HANDLEINPUT Process input while active
GM_GOINACTIVE Gadget deactivated

Built-in Classes

Class Description
rootclass Base class for all BOOPSI objects
gadgetclass Base gadget class
imageclass Base image class
strgclass String entry gadget
buttongclass Button gadget
propgclass Proportional slider
groupgclass Group container
frbuttonclass Framed button
frameiclass Frame image
sysiclass System images (checkmark, etc.)
icclass Interconnection (maps attributes)
modelclass Model for MVC pattern

Creating and Using Objects

Object *button = NewObject(NULL, "frbuttonclass",
    GA_Left,     20,
    GA_Top,      40,
    GA_Width,    100,
    GA_Height,   20,
    GA_Text,     "Click Me",
    GA_ID,       42,
    GA_RelVerify, TRUE,
    TAG_DONE);

AddGadget(win, (struct Gadget *)button, -1);
RefreshGadgets((struct Gadget *)button, win, NULL);

/* Set attribute: */
SetGadgetAttrs((struct Gadget *)button, win, NULL,
    GA_Disabled, TRUE,
    TAG_DONE);

/* Get attribute: */
ULONG value;
GetAttr(GA_Disabled, button, &value);

/* Cleanup: */
RemoveGadget(win, (struct Gadget *)button);
DisposeObject(button);

Writing a Custom Class

Class *myclass = MakeClass(NULL, "gadgetclass", NULL,
                           sizeof(struct MyData), 0);
myclass->cl_Dispatcher.h_Entry = (HOOKFUNC)myDispatcher;

ULONG myDispatcher(Class *cl, Object *o, Msg msg) {
    switch (msg->MethodID) {
        case OM_NEW:    return myNew(cl, o, (struct opSet *)msg);
        case OM_DISPOSE: return myDispose(cl, o, msg);
        case GM_RENDER: return myRender(cl, o, (struct gpRender *)msg);
        default:        return DoSuperMethodA(cl, o, msg);
    }
}

References

  • NDK39: intuition/classusr.h, intuition/classes.h
  • ADCD 2.1: NewObject, DisposeObject, SetAttrs, GetAttr, DoMethod