From 085e06d054119e46549091bf835fa7c5fe147415 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 19 Apr 2015 01:29:22 -0400 Subject: [PATCH] Started documenting object lifetimes. --- docs/lifetimes.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/lifetimes.md diff --git a/docs/lifetimes.md b/docs/lifetimes.md new file mode 100644 index 00000000..b1d41a4b --- /dev/null +++ b/docs/lifetimes.md @@ -0,0 +1,28 @@ +# Object lifetimes + +Know them. + +One of the more annoying parts of libui is that it has to juggle an OS control handle and at least one C data structure for a single uiControl, uiParent, uiWindow, etc. To that end, this document exists to lay the ground rules for object lifetimes. + +## To end programmers + +## Implementation + +Note that control implementations generally don't need to worry about backend-specific information; these are handled by the backends's convenience functions. If you bypass those, however, you *will* need to worry. + +### Backend-Agnostic (uiBox, uiGrid) + +### Windows + +TODO write a lifetimes.c + +### Unix + +see os x section +TODO write a lifetimes.c + +### Mac OS X + +notes about not monitoring references or destruction here +do the whole "keep a reference around" thing +TODO drop the deleted controls view