next up previous contents
Next: Inter client communication Up: Working with other clients Previous: Naming windows and defining

Property Lists

Extra information can be associated with windows. This information can be accessed by all clients using the server. Each property has a name and a unique ID called an Atom. Properties have types which are also indicated using Atoms (eg XA_STRING, XA_PIXMAP). The Atoms for some common properties are predefined in <X11/Xatom.h>. To create an Atom with a name, use

Atom XInternAtom(display,atom_name,only_if_exists)
   char *atom_name;
   int only_if_exists;/*If False then a new atom will be created if necessary;
                        if True, and there is no corresponding atom then None 
                        is returned */
The inverse of this is,
char *XGetAtomName(display,atom)
To obtain the atom type and property format, use
int GetWindowProperty(display,w,property,long_offset,long_length,delete,
   Atom property;
   long long_offset,long_length; /* the length and offset of data to be   
                                 received, in 32-bit quantities     */ 
   Bool delete;            /*if True then the property is deleted   */      
   Atom req_type;          /*AnyPropertyType, etc */               
   Atom *actual_type;      /*RETURN*/                              
   int *actual_format;     /*RETURN data type of returned data*/   
   unsigned long *nitems;  /*RETURN*/                              
   long *bytes_after;      /*RETURN number of bytes left unread */ 
   unsigned char **prop;   /*RETURN*/                              
Possible return values are None, Success, BadWindow, BadMatch

Atom *XListProperties(display,w,num_prop)
   int *num_prop;  /*RETURN*/

   Atom property,type;         
   int format;   /*8,16 or 32*/
   int mode;     /* PropModeReplace, PropModePrePend, PropModeAppend*/ 
   unsigned char *data;        
   int nelements;              

Atom properties[];         


Tim Love
Mon Mar 11 17:03:18 GMT 1996