Laxkit  0.0.7.1
Public Member Functions | Public Attributes | Protected Attributes
Laxkit::anObject Class Reference

Base class for all Laxkit objects. More...

Inheritance diagram for Laxkit::anObject:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 anObject ()
 Set object_id=getUniqueNumber().
virtual ~anObject ()
 Empty virtual destructor.
virtual const charwhattype ()
 Returns the type of anObject.
virtual anObjectduplicate (anObject *ref=NULL)
virtual int inc_count ()
 Increment the data's count by 1. Returns count.
virtual int dec_count ()
 Decrement the count of the data, deleting if count is less than or equal to 0.
virtual int the_count ()

Public Attributes

int suppress_debug
DeleteRefCountedFunc deleteMe
 Called when the count is decremented to 0.
unsigned long object_id
charobject_idstr

Protected Attributes

int _count
 The reference count of the object.

Detailed Description

Base class for all Laxkit objects.

In the constructor, object_id gets assinged a number returned from getUniqueNumber().

Also provides inc_count() and dec_count() for reference counting. Objects are created with a count of 1.


Member Function Documentation

int Laxkit::anObject::dec_count ( )
virtual

Decrement the count of the data, deleting if count is less than or equal to 0.

If count gets decremented to 0, then do the following. If deleteMe!=NULL, then call that. Then, if defaultDeleteRefCountedFunc!=NULL, then call that. Then call "delete this" when count==0.

Returns the count. If 0 is returned, the item is gone, and should not be accessed any more.

References Laxkit::defaultDeleteRefCountedFunc.

Referenced by Laxkit::FontManagerXlib::Add(), Laxkit::SplitWindow::Add(), Laxkit::ShortcutManager::AddArea(), LaxInterfaces::ViewerWindow::AddTool(), Laxkit::TabFrame::AddWin(), Laxkit::StackFrame::AddWin(), Laxkit::RowFrame::AddWin(), Laxkit::anXApp::addwindow(), Laxkit::SplitWindow::Change(), Laxkit::CheckBox::CheckBox(), Laxkit::LaxMouse::clearReceiver(), Laxkit::LaxKeyboard::clearReceiver(), Laxkit::PanUser::createNewPanner(), LaxInterfaces::CaptionInterface::deletedata(), LaxInterfaces::ImageInterface::deletedata(), LaxInterfaces::GradientInterface::deletedata(), LaxInterfaces::RectInterface::deletedata(), LaxInterfaces::PointWarpInterface::deletedata(), LaxInterfaces::PatchInterface::deletedata(), LaxInterfaces::PathInterface::deletedata(), Laxkit::ButtonDownInfo::down(), LaxInterfaces::Path::dump_in_atts(), LaxInterfaces::PathsData::dump_in_atts(), Laxkit::ShortcutManager::dump_in_atts(), LaxInterfaces::Coordinate::duplicateAll(), Laxkit::FinalizeShortcutManager(), Laxkit::RefPtrStack< T >::flush(), Laxkit::DisplayerXlib::font(), Laxkit::InstallShortcutManager(), LaxInterfaces::ImageData::LoadImage(), Laxkit::PaletteWindow::LoadPalette(), Laxkit::FontManagerCairo::MakeFontFromStr(), LaxInterfaces::ViewportWindow::Push(), Laxkit::RefPtrStack< T >::remove(), Laxkit::anXApp::reparent(), Laxkit::ButtonDownInfo::replaceextra(), Laxkit::StackFrame::ReplaceWin(), LaxInterfaces::ImagePatchInterface::runImageDialog(), LaxInterfaces::ImageInterface::runImageDialog(), Laxkit::IconBox::SetBox(), Laxkit::SetDefaultDisplayer(), Laxkit::LaxKeyboard::SetFocus(), Laxkit::Button::SetGraphic(), Laxkit::Button::SetIcon(), LaxInterfaces::ImageData::SetImage(), Laxkit::PanWindow::SetImage(), Laxkit::MenuButton::SetMenu(), Laxkit::SplitWindow::SwapWithMarked(), Laxkit::anXApp::tooltipcheck(), Laxkit::TextXEditBaseUtf8::UseThisFont(), Laxkit::PanUser::UseThisPanner(), Laxkit::Button::~Button(), Laxkit::ButtonDownInfo::ButtonDownInfoSpecific::~ButtonDownInfoSpecific(), Laxkit::DisplayerXlib::~DisplayerXlib(), LaxInterfaces::GradientInterface::~GradientInterface(), Laxkit::IconBox::~IconBox(), Laxkit::ImageDialog::~ImageDialog(), Laxkit::MenuButton::~MenuButton(), Laxkit::PanUser::~PanUser(), LaxInterfaces::Path::~Path(), LaxInterfaces::PathInterface::~PathInterface(), LaxInterfaces::PathsData::~PathsData(), Laxkit::RulerWindow::~RulerWindow(), Laxkit::TextXEditBaseUtf8::~TextXEditBaseUtf8(), Laxkit::TreeSelector::~TreeSelector(), LaxInterfaces::ViewportWindow::~ViewportWindow(), and Laxkit::WinFrameBox::~WinFrameBox().

const char * Laxkit::anObject::whattype ( )
inlinevirtual

Returns the type of anObject.

Usually, this corresponds to the C++ class name. However, it is also intended to be used to say what the object should be considered to be. For instance, if you subclass ImagePatchInterface to behave better, the program should still think of it as an ImagePatchInterface, which is something the C++ typeinfo features are not really designed for.

Referenced by LaxInterfaces::PathInterface::ChangeCurpathop().


Member Data Documentation

int Laxkit::anObject::_count
protected

The reference count of the object.

Controlled with inc_count() and dec_count(). When the count is less or equal to 0, then deleteMe is called. See dec_count() for more.

Referenced by Laxkit::anXApp::destroywindow(), and Laxkit::anXApp::reparent().

DeleteRefCountedFunc Laxkit::anObject::deleteMe

Called when the count is decremented to 0.

See dec_count() for more.


The documentation for this class was generated from the following files:

Mon Feb 17 2014 11:52:58, Laxkit