00001 /*-------------------------------------------------------------------- 00002 * vnode.h 00003 * 00004 * A "vnode" object is a visual object that represents any client object. 00005 * It is used as a handle in the visual system. It contains a pointer 00006 * a pointer to the actual object, a tag that is a string identifying the 00007 * type of the object, a list of visual properties (vprops) that the 00008 * object has. 00009 * 00010 * When the object is freed, its dual vnode should also be deleted. 00011 * The visual_manager keeps track of all the vnodes, and makes sure that 00012 * there is only one vnode per client object. 00013 * 00014 */ 00015 00016 #ifndef VNODE_H 00017 #define VNODE_H 00018 00019 #include "common/suif_list.h" 00020 00021 00022 class vprop; 00023 00024 class vnode { 00025 private: 00026 friend vprop; 00027 00028 char *tag; 00029 void *object; 00030 void *aux_data; 00031 00032 // slist_tos<vprop*> *props; 00033 list<vprop*> *props; 00034 00035 void add_prop(vprop *prop); 00036 void remove_prop(char *prop_name); 00037 void remove_prop(vprop *prop); 00038 00039 public: 00040 vnode(void); 00041 vnode(void *const obj, const char *const tag); 00042 vnode(void *const obj, const char *const tag, void *data); 00043 ~vnode(void); 00044 00045 char *get_tag(void) const { return tag; } 00046 void *get_object(void) const { return object; } 00047 void *get_data(void) const { return aux_data; } 00048 void set_object(void *const obj) { object = obj; } 00049 00050 /* properties */ 00051 vprop *get_prop(char *prop_name); 00052 //tos_ref<vprop*> get_prop_list(void); 00053 list<vprop*>* get_prop_list(void); 00054 }; 00055 00056 //typedef slist_tos<vnode*> vnode_list; 00057 typedef list<vnode*> vnode_list; 00058 typedef list<vnode *>::iterator vlist_iter; 00059 00060 #endif