Index: /trunk/nv/gfx/image.hh
===================================================================
--- /trunk/nv/gfx/image.hh	(revision 109)
+++ /trunk/nv/gfx/image.hh	(revision 110)
@@ -31,5 +31,5 @@
 	 * By an image we understand a group of pixels, limited to X and Y
 	 * dimensions, of a certain depth (by depth we mean how rich
-	 * the colors are.
+	 * the colors are).
 	 */
 	class image
Index: /trunk/nv/gfx/texture_font.hh
===================================================================
--- /trunk/nv/gfx/texture_font.hh	(revision 109)
+++ /trunk/nv/gfx/texture_font.hh	(revision 110)
@@ -18,14 +18,24 @@
 	struct texture_glyph
 	{
-		uint16 charcode;
-		glm::ivec2 size;
-		glm::ivec2 offset;
-		glm::vec2 advance;
-		glm::vec2 tl;
-		glm::vec2 br;
-		std::unordered_map< uint16, float > kerning;
+		uint16 charcode; ///< Character code value.
+		glm::ivec2 size; ///< Width and height of the glyph.
+		glm::ivec2 offset; ///< Offset of the glyph's position from the base line.
+		glm::vec2 advance; ///< Cursor advance distance.
+		glm::vec2 tl; ///< Top-left of the glyph's bounding box.
+		glm::vec2 br; ///< Bottom-right of the glyph's bounding box.
+		std::unordered_map< uint16, float > kerning; ///< Kerning space between other characters.
 
+		/**
+		 *Creates a new texture_glyph.
+		 */
 		texture_glyph();
-		float get_kerning( const uint16 charcode );
+
+		/**
+		 *Gets the kerning space between this character and the requested character.
+		 *
+		 *@param charcode The character to get the spacing for.
+		 *@returns The amount of space for kerning.
+		 */
+		float get_kerning( const uint16 charcode ); 
 	};
 
@@ -40,17 +50,17 @@
 			void generate_kerning();
 		private:
-			std::unordered_map< uint16, texture_glyph > m_glyphs;
-			texture_atlas* m_atlas;
-			std::string m_filename;
-			float m_size;
-			float m_height;
-			float m_linegap;
-			float m_ascender;
-			float m_descender;
-			bool m_hinting;
-			bool m_filtering;
-			uint8 m_lcd_weights[5];
-			void* m_rlibrary;
-			void* m_rface;
+			std::unordered_map< uint16, texture_glyph > m_glyphs; ///< Hash table of glyphs for this font.
+			texture_atlas* m_atlas; ///< Atlas Image object for this font.
+			std::string m_filename; ///< Name of the file.
+			float m_size; ///< Font size.
+			float m_height; ///< Height of the font. (x-height?)
+			float m_linegap; ///< Amount of space between lines.
+			float m_ascender; ///< Height of ascender lines (lines extending above the glyph's x-height).
+			float m_descender; ///< Height of descender lines (lines extending below the glyph's x-height).
+			bool m_hinting; ///< Whether or not glyph hints are used.
+			bool m_filtering; ///< Whether or not glyphs are color filtered for LCD displays.
+			uint8 m_lcd_weights[5]; ///< Color filtering weights.
+			void* m_rlibrary; ///< Pointer to the library.
+			void* m_rface; ///< Pointer to the font face.
 	};
 }
Index: /trunk/nv/gui/gui_element.hh
===================================================================
--- /trunk/nv/gui/gui_element.hh	(revision 109)
+++ /trunk/nv/gui/gui_element.hh	(revision 110)
@@ -26,40 +26,184 @@
 		{
 		public:
+
+			/**
+			 *Creates a new GUI element.
+			 */
 			element() : object() {}
+
+			/**
+			 *Creates a new GUI element with the give root node and postioning data.
+			 *
+			 *@param aroot The root object that will be this object's parent.
+			 *@param r The rectangle representing the position and size of this element.
+			 */
 			element( root* aroot, const rectangle& r );
+
+			/**
+			 *Gets the deepest child element that contains the indicated point.
+			 *
+			 *@param p The position to check.
+			 *@returns The last child element that contains the given point.
+			 */
 			element* get_element( const position& p );
+
+			/**
+			 *Event handler for update events.  Calls on_update for all affected children.
+			 *
+			 *@param elapsed Time since last update.
+			 */
 			virtual void on_update( uint32 elapsed );
+
+			/**
+			 *Event handler for draw events.  Calls on_draw for all affected children.
+			 */
 			virtual void on_draw();
+
+			/**
+			 *Event handler for IO events.  Class on_event for all affected children.
+			 *
+			 *@param event The event data.
+			 *@returns ???
+			 */
 			virtual bool on_event( const io_event& event );
+
+			/**
+			 *Checks if this element contains the given point.
+			 *
+			 *@param p The point to check.
+			 *@returns True if the point is within the region of the element, false otherwise.
+			 */
 			virtual bool contains( const position& p ) const;
+
+			/**
+			 *Sets the position and size of this element relative to its parent.
+			 *
+			 *@param r The new position and size of the element.
+			 */
 			virtual void set_relative( const rectangle& r );
+
+			/**
+			 *Sets the position of this element relative to its parent.
+			 *
+			 *@param p The new position of the element.
+			 */
 			virtual void set_relative( const position& p );
+
+			/**
+			 *Gets the position and size of the element relative to its parent.
+			 *
+			 *@returns The element's position and size relative to its parent.
+			 */
 			virtual const rectangle& get_relative() const { return m_relative; }
+
+			/**
+			 *Gets the position and size of the element relative to the root (window).
+			 *
+			 *@returns The element's position and size relative to the root (window).
+			 */
 			virtual const rectangle& get_absolute() const { return m_absolute; }
+
+			/**
+			 *Gets the parent element of this element.
+			 *
+			 *@returns The parent element.
+			 */
 			virtual element* get_parent() const { return (element*)m_parent; }
+
+			/**
+			 *Gets whether this element is currently accepting events.
+			 *
+			 *@returns True if the element is receiving events, false otherwise.
+			 */
 			virtual bool is_enabled() const { return m_enabled; }
+
+			/**
+			 *Gets whether this element is currently visible.
+			 *
+			 *@returns True if the element is visible, false otherwise.
+			 */
 			virtual bool is_visible() const { return m_visible; }
+
+			/**
+			 *Gets whether this element needs to be redrawn.
+			 *
+			 *@returns True if the element needs to be redrawn, false if not.
+			 */
 			virtual bool is_dirty()   const { return m_dirty; }
+
+			/**
+			 *Sets whether this element is currently accepting events.
+			 *
+			 *@param value True to allow the element and its children to receive events, false to disable.
+			 */
 			virtual void set_enabled( bool value ) { m_enabled = value; }
+
+			/**
+			 *Sets whether this element is visible on the screen.
+			 *
+			 *@param value True to display the element and its children, false to hide it and its children.
+			 */
 			virtual void set_visible( bool value ) { m_visible = value; }
+
+			/**
+			 *Sets whether this element needs to be redrawn.
+			 *
+			 *@param value True to request that the element and its children be redrawn, false if not.
+			 */
 			virtual void set_dirty( bool value )   { m_dirty   = value; }
+
+			/**
+			 *Gets the text associated with this element.
+			 *
+			 *@returns A string containing the associated text.
+			 */
 			virtual const string& get_text() const { return m_text; }
+
+			/**
+			 *Sets the text associated with this element.
+			 *
+			 *@param text The new text to associate with this element.
+			 */
 			virtual void set_text( const string& text ) { m_text = text; m_dirty = true; }
+
+			/**
+			 *Gets the class name associated with this element.
+			 *
+			 *@returns A string containing the class name of this element.
+			 */
 			virtual const string& get_class() const { return m_class; }
+
+			/**
+			 *sets the class name associated with this element.
+			 *
+			 *@param class_ The new class name.
+			 */
 			virtual void set_class( const string& class_ ) { m_class = class_; m_dirty = true; }
+
+			/**
+			 *Recalcuates the absolute position of the element and the element's children.
+			 */
 			virtual void recalculate_absolute();
+
+			/**
+			 *Recalculates the aboslute position of the element's children.
+			 */
 			virtual void recalculate_absolute_children();
+
+			/**
+			 *Destroys the element.
+			 */
 			virtual ~element();
 		protected:
 			friend class environment;
 
-			string    m_class;
-			string    m_text;
-			rectangle m_relative;
-			rectangle m_absolute;
-			bool m_enabled;
-			bool m_visible;
-			bool m_dirty;
-			render_data* m_render_data;
+			string    m_class; ///< Class name.
+			string    m_text; ///< Displayed label or text.
+			rectangle m_relative; ///< Position relative to parent.
+			rectangle m_absolute; ///< Position relative to window/screen.
+			bool m_enabled; ///< Whether the element accepts events.
+			bool m_visible; ///< Whether the element is drawn.
+			bool m_dirty; ///< Whether the element needs updating.
+			render_data* m_render_data; ///<   -?-
 		};
 
Index: /trunk/nv/interface/render_state.hh
===================================================================
--- /trunk/nv/interface/render_state.hh	(revision 109)
+++ /trunk/nv/interface/render_state.hh	(revision 110)
@@ -186,6 +186,6 @@
 	};
 
-} // namespace nova
+} // namespace nv
 
 
-#endif // NOVA_RENDER_STATE_HH
+#endif // NV_RENDER_STATE_HH
Index: /trunk/nv/io_event.hh
===================================================================
--- /trunk/nv/io_event.hh	(revision 109)
+++ /trunk/nv/io_event.hh	(revision 110)
@@ -67,7 +67,9 @@
 	struct mouse_button_event
 	{
+		/// X position where mouse was clicked.
 		uint16 x;
+		/// Y position where mouse was clicked.
 		uint16 y;
-		///
+		/// Button that was clicked.
 		uint32 button;
 		/// True if pressed
@@ -79,7 +81,11 @@
 	struct mouse_move_event
 	{
+		/// X Position the mouse moved to.
 		uint16 x;
+		/// Y Position the mouse moved to.
 		uint16 y;
+		/// Distance in x direction mouse was moved.
 		sint16 rx;
+		/// Distance in y direction mouse was moved.
 		sint16 ry;
 		/// True if pressed
@@ -91,5 +97,7 @@
 	struct resize_event
 	{
+		/// New x size of the object.
 		sint32 x;
+		/// New y size of the object.
 		sint32 y;
 	};
@@ -97,4 +105,5 @@
 	struct active_event
 	{
+		/// Whether focus was gained or lost.
 		bool gain;
 	};
@@ -121,7 +130,33 @@
 	};
 
+	/**
+	 *Gets the name of the key given the code.
+	 *
+	 *@param key The code value of the key.
+	 *@returns The name of the key.
+	 */
 	const char* get_key_name( key_code key );
+
+	/**
+	 *Gets the name of the mouse button given the code.
+	 *
+	 *@param button The code value of the mouse button.
+	 *@returns The name of the button.
+	 */
 	const char* get_mouse_name( mouse_code button );
+
+	/**
+	 *Gets the name of the IO event given the code.
+	 *
+	 *@param event The code value of the IO event.
+	 *@returns The name of the event.
+	 */
 	const char* get_io_event_name( io_event_code event );
+
+	/**
+	 *Registers all events to the specified database.
+	 *
+	 *@param db The database to store all event data in.
+	 */
 	void register_io_types( type_database* db );
 }
Index: /trunk/nv/position.hh
===================================================================
--- /trunk/nv/position.hh	(revision 109)
+++ /trunk/nv/position.hh	(revision 110)
@@ -35,35 +35,195 @@
 			struct { value_type x1,y1,x2,y2; };
 		};
-
+		/**
+		 *Creates a new rectangle assigned to {0, 0, 0, 0}.
+		 */
 		rectangle() : ul(), lr() {}
+		
+		/**
+		 *Creates a new rectangle given a position.
+		 *
+		 *@param p The position to assign the rectangle to.
+		 */
 		rectangle( position p ) : ul(p), lr(p) {}
+		
+		/**
+		 *Creates a new rectangle given an upper-left and lower-right position.
+		 *
+		 *@param ul The position of the upper-left corner of the rectangle.
+		 *@param lr The position of the lower-right corner of the rectangle.
+		 */
 		rectangle( position ul, position lr ) : ul(ul), lr(lr) {}
+		
+		/**
+		 *Creates a new rectangle given an upper-left position, width, and height.
+		 *
+		 *@param ul The position of the upper-left corner of the rectangle.
+		 *@param width The width of the rectangle.
+		 *@param height The height of the rectangle.
+		 */
 		rectangle( position ul, value_type width, value_type height ) : ul(ul), lr(ul + position(width,height)) {}
+		
+		/**
+		 *Sets the dimensions of the rectangle without moving the upper-left of the rectangle.
+		 *
+		 *@param d The new dimensions of the rectangle.
+		 */
 		rectangle& dim( dimension d ) { lr = ul + d; return *this; }
+
+		/**
+		 *Moves the rectangle to a new position while maintaining its size.
+		 *
+		 *@param p The new position of the rectangle's upper-left corner.
+		 */
 		rectangle& pos( position p )  { lr = p + (lr - ul); lr = p; return *this; }
 
+		/**
+		 *Sets the dimensions of the rectangle without moving the upper-left of the rectangle.
+		 *
+		 *@param d The new dimensions of the rectangle.
+		 */
 		void set_dimension( dimension d ) { lr = ul + d; }
+		
+		/**
+		 *Moves the rectangle to a new position while maintaining its size.
+		 *
+		 *@param p The new position of the rectangle's upper-left corner.
+		 */
 		void set_position( position p ) { lr = p + (lr - ul); ul = p; }
 
+		/**
+		 *Gets the dimensions of the rectangle.  Synonym for get_size.
+		 *
+		 *@returns The dimensions of the rectangle.
+		 *@see get_size
+		 */
 		dimension get_dimension() const { return lr - ul; }
+
+		/**
+		 *Gets the position of the upper-left corner of the rectangle.
+		 *
+		 *@returns The position of the rectangle's upper-left corner.
+		 */
 		position  get_position() const { return ul; }
+
+		/**
+		 *Gets the dimensions of the rectangle.  Synonym for get_dimension.
+		 *
+		 *@returns The dimensions of the rectangle.
+		 *@see get_dimension
+		 */
 		dimension get_size() const { return lr - ul; }
+
+		/**
+		 *Gets the center of the rectangle.
+		 *
+		 *@returns The center of the rectangle.
+		 */
 		position get_center() const { return ( lr + ul ) / 2; }
+
+		/**
+		 *Gets the width of the rectangle.
+		 *
+		 *@returns The width of the rectangle.
+		 */
 		value_type get_width() const { return x2 - x1; }
+
+		/**
+		 *Gets the height of the rectangle.
+		 *
+		 *@returns The height of the rectangle.
+		 */
 		value_type get_height() const { return y2 - y1; }
+
+		/**
+		 *Gets the area of the rectangle.
+		 *
+		 *@returns The area of the rectangle.
+		 */
 		value_type get_area() const { return (y2 - y1) * (x2 - x1); }
+
+		/**
+		 *Checks to see if the rectangle is backwards.
+		 *
+		 *@returns True if the rectangle's upper-left is above and left (or equal to) the rectangle's lower-right, false if it is not.
+		 */
 		bool is_valid() const {	return x2 >= x1 && y2 >= y1; }
 		
+		/**
+		 *Shifts the rectangle by a given amount.
+		 *
+		 *@param pos The amount to shift the rectangle by.
+		 */
 		rectangle& operator+=( const position& pos ) { ul += pos; lr += pos; return (*this); }
+
+		/**
+		 *Returns a rectangle shifted by a given amount.
+		 *
+		 *@param pos The amount to shift by. 
+		 *@returns The shifted rectangle.
+		 */
 		rectangle operator+( const position& pos ) const {	rectangle r(*this); return r += pos; }
+
+		/**
+		 *Shifts the rectangle by a given amount.
+		 *
+		 *@param pos The amount to shift the rectangle by.
+		 */
 		rectangle& operator-=( const position& pos ) { ul -= pos; lr -= pos; return (*this); }
+
+		/**
+		 *Returns a rectangle shifted by a given amount.
+		 *
+		 *@oaram pos The amount to shift by.
+		 *@returns The shifted rectangle.
+		 */
 		rectangle operator-( const position& pos ) const {	rectangle r(*this); return r -= pos; }
+
+		/**
+		 *Compares two rectangles to see if they are the same.
+		 *
+		 *@param r The rectangle to compare to.
+		 *@returns True if the rectangles have the same positions and dimensions, false otherwise.
+		 */
 		bool operator==( const rectangle& r ) const { return r.ul == ul && r.lr == lr; }
+
+		/**
+		 *Compares two rectangles to see if they are different.
+		 *
+		 *@param r The rectangle to compare to.
+		 *@returns True if the rectangles have different positions or dimensions, false otherwise.
+		 */
 		bool operator!=( const rectangle& r ) const { return r.ul != ul || r.lr != lr; }
 
+		/**
+		 *Checks if a position is within the bounds of this rectangle.
+		 *
+		 *@param r The position to check.
+		 *@returns True if the position is inside or on the edge of the rectangle, false otherwise.
+		 */
 		bool contains( const position& r ) const{ return y2 >= r.y && y1 <= r.y && x2 >= r.x && x1 <= r.x; }
+
+		/**
+		 *Checks if a rectangle is within the bounds of this rectangle.
+		 *
+		 *@param r The rectangle to check.
+		 *@returns True if the entire rectangle to check is inside or on the edge of this rectangle, false otherwise.
+		 */
 		bool contains( const rectangle& r ) const { return contains( r.ul ) && contains( r.lr ); }
+
+		/**
+		 *Checks if another rectangle overlaps this one.
+		 *
+		 *@param r The rectangle to check.
+		 *@returns True if any part of the rectangle to check overlaps this rectangle, false otherwise.
+		 */
 		bool collides( const rectangle& r ) const { return y2 > r.y1 && y1 < r.y2 && x2 > r.x1 && x1 < r.x2; }
 
+		/**
+		 *Limits the region of the rectangle to the inidicated rectangle.
+		 *
+		 *@param r The rectangle that this rectangle is confined to.
+		 *@returns True if the rectangle was changed, false otherwise.
+		 */
 		bool clamp_to( const rectangle& r )
 		{
@@ -75,4 +235,10 @@
 		}
 
+		/**
+		 *Limits the size of the rectangle to the given rectangle's size.
+		 *
+		 *@param r The rectangle representing the maximum dimensions this rectangle can be.
+		 *@returns True if the rectangle needed to be resized, false otherwise.
+		 */
 		bool constrain_to( const rectangle& r )
 		{
@@ -83,4 +249,7 @@
 		}
 
+		/**
+		 *Fixes an invalid rectangle.
+		 */
 		void repair() 
 		{
@@ -89,4 +258,9 @@
 		}
 
+		/**
+		 *Expands the rectangle to just include the given point.
+		 *
+		 *@param p The point to include in the rectangle.
+		 */
 		void include_point( position p )
 		{
Index: /trunk/nv/singleton.hh
===================================================================
--- /trunk/nv/singleton.hh	(revision 109)
+++ /trunk/nv/singleton.hh	(revision 110)
@@ -18,12 +18,19 @@
 namespace nv
 {
-
+	/**
+	 *singleton
+	 *@brief Represents an accessible static object that will only have one instance.
+	 */
     template <class T>
     class singleton
     {
     private:
-        static T *singleton_;
+        static T *singleton_; ///< Pointer to the instance of this object type.
 
     protected:
+
+		/**
+		 *Creates the single instance if one doesn't already exist.
+		 */
         singleton()
         {
@@ -32,4 +39,7 @@
         }
 
+		/**
+		 *Destroys the instance.
+		 */
         ~singleton()
         {
@@ -39,8 +49,19 @@
 
     public:
+		/**
+		 *Checks to see if the instance exists.
+		 *
+		 *@returns True if this singleton has an instance assigned, false otherwise.
+		 */
         static bool is_valid()
         {
             return singleton_ != 0;
         }
+
+		/**
+		 *Returns the pointer to the instance.
+		 *
+		 *@returns The pointer to the instance.
+		 */
         static T *pointer()
         {
@@ -48,4 +69,7 @@
             return singleton_;
         }
+		/**
+		 *Returns the object referenced by this singleton.
+		 */
         static T &reference()
         {
@@ -58,8 +82,16 @@
     T* singleton<T>::singleton_ = 0;
 
+
+	/**
+	 *auto_singleton
+	 *@brief Represents a singleton that automatically creates an instance if one doesn't already exist.
+	 */
     template <class T>
     class auto_singleton : public singleton<T>
     {
     public:
+		/**
+		 *Returns the pointer to the instance.  Makes an instance if one doesn't already exist.
+		 */
         static T *pointer()
         {
@@ -70,4 +102,8 @@
             return singleton<T>::pointer();
         }
+
+		/**
+		 *Returns the object referenced by this singleton.  Makes an instance if one doesn't already exist.
+		 */
         static T &reference()
         {
Index: /trunk/nv/uid.hh
===================================================================
--- /trunk/nv/uid.hh	(revision 109)
+++ /trunk/nv/uid.hh	(revision 110)
@@ -22,11 +22,61 @@
 	{
 	public:
+		
+		/**
+		 *Creates a new instance of the unique indentifer store.
+		 */
 		uid_store();
+
+		/**
+		 *Gets the object with the specified ID.
+		 *
+		 *@param auid The ID to fetch.
+		 *@returns The stored object for that ID.
+		 */
 		object* get( uid auid ) const;
+
+		/**
+		 *Removes the object with the specified ID.
+		 *
+		 *@param auid The ID to remove.
+		 *@returns True if the removal was successful, false if the ID didn't exist.
+		 */
 		bool remove( uid auid );
+
+		/**
+		 *Adds an object to the store assigned to the indicated ID.
+		 *
+		 *@param o The object to add to the store.
+		 *@param auid The ID to assign to the object.
+		 */
 		void insert( object* o, uid auid );
+
+		/**
+		 *Adds an object to the store and assigns it a new ID.
+		 *
+		 *@param o The object to add to the store.
+		 *@returns The ID the object was store under.
+		 */
 		uid insert( object* o );
+
+		/**
+		 *Gets the next available ID.
+		 *
+		 *@returns The next ID in the store.
+		 */
 		uid request_uid();
+
+		/**
+		 *Destroys the unique identifier store.
+		 */
 		~uid_store();
+
+		/**
+		 *Retrieves an object and casts it to the specified type.
+		 *
+		 *@tparam T The type to cast to.
+		 *@param auid The ID the object is stored under.
+		 *@returns An object of the indicated type that was stored at the indicated ID.
+		 */
 		template< typename T >
 		T* get_as( uid auid ) const 
@@ -36,6 +86,6 @@
 	private:
 		typedef std::unordered_map< uid, object* > map;
-		map m_map;
-		uid m_current;
+		map m_map; ///< The hash map everything is stored in.
+		uid m_current; ///< The last UID assigned.
 	};
 }
