package Agar::Object; use strict; use Agar; 1; __END__ =head1 NAME Agar::Object - Agar's general base class =head1 SYNOPSIS use Agar::Object; =head1 DESCRIPTION This is the root class for all Agar objects. It provides useful non-GUI specific features such as event processing / virtual functions, portable serialization, and a virtual filesystem. The Agar object system is implemented in the (non-GUI specific) ag_core library. Agar GUI classes such as L all inherit from B. =head1 INHERITANCE HIERARCHY B =head1 METHODS =over 4 =item B<$object-Eroot()> Returns the C that is at the root of the object tree in which this object resides. =item B<$object-Elock()> Acquires the mutex that protects the read/write members of the object. =item B<$object-Eunlock()> Releases the mutex previously acquired by C. =item B<$object-EsetEvent($eventName,$codeRef)> Arranges for events of the specified type to be handled by the subroutine provided. Overwrites any handler that was previously in place for this event type on this object. When the handler subroutine is called it shall have one argument: the Agar::Event object that is being handled. =item B<$object-EunsetEvent($eventName)> Removes the event handler registered with the object for the specified event type. =item B<$codeRef = $object-EfindEventHandler($eventName)> Returns the handler subroutine associated with the specified event type on this object. If no handler is found, it returns undef. If a handler is found that was not created from Perl, it returns a false but defined value. =item B<$object-Eparent()> Returns the parent object of this one. =item B<$object-EfindChild($name)> Returns the first object found with the specified name among the descendants of the object, or undef if none is found. =item B<$object-EattachTo($newParent)> Attaches the object to another, effectively changing its parent object. =item B<$object-Edetach()> Detach the object from its parent, making it an orphan. =item B<$object-EsetName()> Sets the object's name. =item B<$object-Edowncast()> With a plain Agar::Object or Agar::Widget, attempts to re-bless the reference into the derived class furthest down the inheritance tree. Useful for processing the result of Agar::Event::receiver or Agar::Object::findChild, for example. =back =head1 AUTHOR Mat Sutcliffe EFE Julien Nadeau Carriere EFE =head1 SEE ALSO L, L =cut