Kiwi User Interface Framework  beta
KUList.h
Go to the documentation of this file.
00001 
00008 #import <Foundation/Foundation.h>
00009 #import <Coconut/Coconut.h>
00010 
00014 struct KUListItem
00015 {
00017         struct KUListItem *             nextItem ;
00019         NSObject *                              object ;
00020 } ;
00021 
00025 struct KUList {
00027         size_t                                  itemCount ;
00029         struct KUListItem *             firstItem ;
00031         struct KUListItem *             lastItem ;
00032 } ;
00033 
00039 static inline struct KUListItem *
00040 KUAllocateListItem(struct CNResource * resource)
00041 {
00042         struct KUListItem * newitem = (struct KUListItem *) CNAllocateData(resource, sizeof(struct KUListItem)) ;
00043         if(newitem){
00044                 newitem->nextItem       = NULL ;
00045                 newitem->object         = nil ;
00046         }
00047         return newitem ;
00048 }
00049 
00054 static inline void
00055 KUInitList(struct KUList * dst)
00056 {
00057         dst->itemCount = 0 ;
00058         dst->firstItem = dst->lastItem = NULL ;
00059 }
00060 
00066 void
00067 KUDestroyList(struct CNResource * resource,struct KUList * dst) ;
00068 
00075 void
00076 KUAddObjectToList(struct KUList * dst, NSObject * src, struct CNResource * resource) ;