XamlColor.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00019 #if !defined XAML_COLOR_HEADER
00020 #define XAML_COLOR_HEADER
00021 
00025 
00026 #include "XAML/XamlCore.h"
00027 
00028 #include "whiptk/color.h"
00029 #include "XAML/XamlXML.h"
00030 #include "XAML/XamlDrawableAttributes.h"
00031 
00032 
00037 
00038 
00041 class XAMLTK_API WT_XAML_Color : public WT_Color
00042                                , public XamlDrawableAttributes::Stroke::Provider
00043                                , public XamlDrawableAttributes::Fill::Provider
00044                                , public XamlDrawableAttributes::Stroke::Consumer
00045                                , public XamlDrawableAttributes::Fill::Consumer
00046                                , public XamlDrawableAttributes::PathAttributeProvider
00047                                , public XamlDrawableAttributes::GlyphsAttributeProvider
00048 {
00049     friend class WT_XAML_Class_Factory;
00050     friend class WT_XAML_Rendition;
00051 
00052 protected:
00054 
00055     WT_XAML_Color()
00056     : WT_Color()
00057     , _pSerializeFile(NULL)
00058     { }
00059 
00061 
00062     WT_XAML_Color(
00063         WT_RGBA32 color, 
00064         WT_Color_Map_Mode m = No_Mapping 
00065         )
00066     : WT_Color(color,m)
00067     , _pSerializeFile(NULL)
00068     { }
00069 
00071     WT_XAML_Color(
00072         WT_Color const & color 
00073         )
00074     : WT_Color(color)
00075     , _pSerializeFile(NULL)
00076     { }
00077 
00078 
00080 
00081     WT_XAML_Color(
00082         int red, 
00083         int green, 
00084         int blue, 
00085         WT_Color_Map_Mode m=No_Mapping 
00086         )
00087     : WT_Color(red,green,blue,m)
00088     , _pSerializeFile(NULL)
00089     {  }
00090 
00092 
00093     WT_XAML_Color(
00094         int red, 
00095         int green, 
00096         int blue, 
00097         int alpha, 
00098         WT_Color_Map_Mode m=No_Mapping 
00099         )
00100     : WT_Color(red,green,blue,alpha,m)
00101     , _pSerializeFile(NULL)
00102     { }
00103 
00105 
00107     WT_XAML_Color(
00108         WT_Color_Index index, 
00109         WT_Color_Map const & color_map 
00110         )
00111     : WT_Color(index,color_map)
00112     , _pSerializeFile(NULL)
00113     { }
00114 
00115     virtual ~WT_XAML_Color()
00116     {}
00117 public:
00118 
00119     WT_XAML_Color const & operator= (WT_XAML_Color const & other)
00120     {
00121         set(other);
00122         return *this;
00123     }
00124 
00125     virtual WT_Result   parseAttributeList(XamlXML::tAttributeMap& rMap, WT_File& rFile);
00126 
00127     // Override WT_Attribute virtual method
00128     virtual WT_Result   serialize (WT_File & /*file*/) const;
00129     virtual WT_Result   sync_index(WT_XAML_File & /*file*/);
00130 
00131 protected:
00132     virtual WT_Result provideStroke(XamlDrawableAttributes::Stroke* & rpStroke);
00133     virtual WT_Result provideFill(XamlDrawableAttributes::Fill*& rpFill);
00134     virtual WT_Result provideGlyphsAttributes( XamlDrawableAttributes::GlyphsAttributeConsumer* p, WT_XAML_File& r) const;
00135     virtual WT_Result providePathAttributes( XamlDrawableAttributes::PathAttributeConsumer*, WT_XAML_File& ) const;
00136     virtual WT_Result consumeStroke(XamlDrawableAttributes::Stroke::Provider* );
00137     virtual WT_Result consumeFill(XamlDrawableAttributes::Fill::Provider* );
00138 
00139 private:
00140     WT_XAML_File *_pSerializeFile;
00141 };
00143 
00144 #endif //XAML_COLOR_HEADER

Generated on Tue Jan 6 22:40:05 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5