00001 /* 00002 * Copyright © 2010 Sam Spilsbury 00003 * 00004 * Permission to use, copy, modify, distribute, and sell this software 00005 * and its documentation for any purpose is hereby granted without 00006 * fee, provided that the above copyright notice appear in all copies 00007 * and that both that copyright notice and this permission notice 00008 * appear in supporting documentation, and that the name of 00009 * Dennis Kasprzyk not be used in advertising or publicity pertaining to 00010 * distribution of the software without specific, written prior permission. 00011 * Dennis Kasprzyk makes no representations about the suitability of this 00012 * software for any purpose. It is provided "as is" without express or 00013 * implied warranty. 00014 * 00015 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 00016 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN 00017 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR 00018 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00019 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00020 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00021 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00022 * 00023 * Authors: Sam Spilsbury <smspillaz@gmail.com> 00024 */ 00025 00026 #ifndef _COMPPROPERTYWRITER_H 00027 #define _COMPPROPERTYWRITER_H 00028 00029 #include "core.h" 00030 #include <X11/Xatom.h> 00031 00032 static const CompOption::Vector nilValues; 00033 00034 class PropertyWriter 00035 { 00036 public: 00037 00038 PropertyWriter (); 00039 PropertyWriter (CompString propName, 00040 CompOption::Vector &readTemplate); 00041 00042 bool updateProperty (Window, CompOption::Vector &, int); 00043 void deleteProperty (Window); 00044 const CompOption::Vector & readProperty (Window); 00045 void setReadTemplate (const CompOption::Vector &); 00046 const CompOption::Vector & getReadTemplate (); 00047 00048 private: 00049 00050 CompOption::Vector mPropertyValues; 00051 Atom mAtom; 00052 }; 00053 00054 #endif