00001 /* 00002 * Copyright © 2008 Dennis Kasprzyk 00003 * Copyright © 2007 Novell, Inc. 00004 * 00005 * Permission to use, copy, modify, distribute, and sell this software 00006 * and its documentation for any purpose is hereby granted without 00007 * fee, provided that the above copyright notice appear in all copies 00008 * and that both that copyright notice and this permission notice 00009 * appear in supporting documentation, and that the name of 00010 * Dennis Kasprzyk not be used in advertising or publicity pertaining to 00011 * distribution of the software without specific, written prior permission. 00012 * Dennis Kasprzyk makes no representations about the suitability of this 00013 * software for any purpose. It is provided "as is" without express or 00014 * implied warranty. 00015 * 00016 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 00017 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN 00018 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR 00019 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00020 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00021 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00022 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00023 * 00024 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org> 00025 * David Reveman <davidr@novell.com> 00026 */ 00027 00028 #ifndef _PLUGINCLASSES_H 00029 #define _PLUGINCLASSES_H 00030 00031 #include <vector> 00032 00036 class PluginClassIndex { 00037 public: 00038 PluginClassIndex () : index ((unsigned)~0), refCount (0), 00039 initiated (false), failed (false), 00040 pcFailed (false), pcIndex (0) {} 00041 00042 unsigned int index; 00043 int refCount; 00044 bool initiated; 00045 bool failed; 00046 bool pcFailed; 00047 unsigned int pcIndex; 00048 }; 00049 00054 class PluginClassStorage { 00055 00056 public: 00057 typedef std::vector<bool> Indices; 00058 00059 public: 00060 PluginClassStorage (Indices& iList); 00061 00062 public: 00063 std::vector<void *> pluginClasses; 00064 00065 protected: 00066 static unsigned int allocatePluginClassIndex (Indices& iList); 00067 static void freePluginClassIndex (Indices& iList, unsigned int idx); 00068 }; 00069 00070 #endif