[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

Class:                  gadgetclass
Superclass:             rootclass
Include File:           <intuition/gadgetclass.h>

This is a base class for Intuition compatible gadget objects.  The
dispatcher for this class takes care of creating an Intuition Gadget
structure as part of its local instance data.  All of the standard Boopsi
gadget classes build on this class.  Normally there are no direct
instances of this class, only instances of subclasses of gadgetclass.

The behavior of a Boopsi gadget depends on how it handles the five Boopsi
gadget methods: GM_HITTEST, GM_RENDER, GM_GOACTIVE, GM_HANDLEINPUT, and
GM_GOINACTIVE.  Intuition controls a Boopsi gadget by sending it these
types of messages.  The structures that these methods use for their
messages begin with the method's ID followed by a pointer to a GadgetInfo
structure (defined in <intuition/cghooks.h>).  The GadgetInfo structure is
a read-only structure that contains information about the gadget's
rendering environment.  The gadget uses this to find things like its
window, screen, or pen array.  Although this structure does contain a
pointer to a RastPort for the gadget, the gadget must not use this
RastPort for rendering.  The gadget can obtain a RastPort for rendering by
calling the Intuition function ObtainGIRPort() using the GadgetInfo
structure.  See the intuition.library Autodocs for more details on this
function.

These methods are not defined directly by gadgetclass.  It is up to
subclasses of gadgetclass to implement them.

Like all Boopsi methods, these methods run on the context of the task that
called the method.  Normally, Intuition is the only entity that calls
these methods, so these normally operate in the input.device's task.
Because a gadget may have to process a large number of input events, poor
implementations of gadget methods (especially the GM_HANDLEINPUT method)
can degrade system performance.

New Methods:
------------
 GM_HITTEST    GM_GOACTIVE       GM_GOINACTIVE 
 GM_RENDER     GM_HANDLEINPUT 

Changed Methods:
----------------
 OM_NEW    OM_NOTIFY 

Attributes:
-----------
 GA_Previous (I) 
 ICA_TARGET (IS) 
 ICA_MAP (IS) 
 GA_Left, GA_Top, GA_Width, GA_Height (IS) 
 GA_RelRight, GA_RelBottom, GA_RelWidth, GA_RelHeight (IS) 

The remaining attributes defined by gadgetclass are used to set the fields
in the Gadget structure of the Boopsi gadget.  Some Boopsi gadgets do not
pay attention to many of the fields in its Gadget structure, so most
applications will not have to worry about the majority of these
attributes.  Some gadget classes assign special meanings to these
attributes.  See the documentation of the specific gadget classes for more
details.

 GA_IntuiText, GA_Text, GA_LabelImage (IS) 
 GA_Image (IS) 
 GA_Border, GA_SelectRender, GA_ID, GA_UserData, GA_SpecialInfo (IS) 
 GA_GZZGadget, GA_SysGadget (IS) 
 GA_Disabled, GA_Selected (IS) 
 GA_EndGadget, GA_Immediate, GA_RelVerify, GA_FollowMouse, (IS)     
 GA_RightBorder, GA_LeftBorder, GA_TopBorder, GA_BottomBorder, (IS) 
 GA_ToggleSelect, GA_TabCycle (IS)                                  
 GA_Highlight (IS) 
 GA_SysGType (IS)