layer.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-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 #if !defined LAYER_HEADER
00019 #define LAYER_HEADER
00020 
00024 
00025 #include "whiptk/whipcore.h"
00026 #include "whiptk/list.h"
00027 #include "whiptk/attribute.h"
00028 
00029 class WT_File;
00030 
00035 
00036 
00039 class WHIPTK_API WT_Layer : public WT_Item, public WT_Attribute
00040 {
00041         friend class WT_Rendition;
00042         friend class WT_Class_Factory;
00043         friend class WT_W2D_Class_Factory;
00044         friend class WT_Opcode;
00045         friend class WT_Layer_List;
00046 
00047 
00048 private:
00049     WT_String               m_layer_name;
00050     WT_Integer32            m_layer_num;
00051     WT_Boolean              m_visibility;
00052     int                     m_incarnation;
00053     enum WT_Materialize_Stage
00054     {
00055         Gathering_Layer_Number,
00056         Gathering_Layer_Name,
00057         Eating_End_Whitespace
00058     } m_stage;
00059 
00060     void _deleteObject(void *object)
00061     {
00062         delete (WT_Layer*)object;
00063     }
00064 
00065 
00066 public:
00067 
00069 
00070     WT_Layer()
00071         : m_layer_num(0)
00072         , m_visibility(WD_True)
00073         , m_incarnation(-1)
00074         , m_stage(Gathering_Layer_Number)
00075     { }
00077     WT_Layer(
00078         WT_File &file, 
00079         WT_Integer32 layer_num, 
00080         char const * layer_name=WD_Null 
00081         );
00083     WT_Layer(
00084         WT_File &file, 
00085         WT_Integer32 layer_num, 
00086         WT_Unsigned_Integer16 const * layer_name 
00087         );
00089     WT_Layer (WT_Layer const & layer);
00090 
00091         virtual ~WT_Layer()
00092         {}
00094 public:
00096 
00097     WT_String const & layer_name() {    return m_layer_name;    }
00099     WT_Integer32 const& layer_num() const {    return m_layer_num; } 
00100         WT_Integer32&   layer_num() {    return m_layer_num; }
00101 
00103     void set(
00104         char const * layer_name, 
00105         WT_File & file 
00106         );
00108     void set(
00109         WT_Unsigned_Integer16 const * layer_name, 
00110         WT_File & file  
00111         );
00113     void set(WT_Layer const &layer);
00115 
00123     void set_visibility(WT_Boolean vis) {m_visibility = vis;}
00125     WT_Boolean  visibility() {    return m_visibility; }
00127     WT_Layer const & operator=(WT_Layer const & layer);
00129 
00131     WT_ID            object_id() const;
00132     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00133     WT_Result        process(WT_File & file);
00134     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00135     WT_Result        serialize (WT_File & file) const;
00136     WT_Result        sync (WT_File & file) const;
00137     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00139 
00141 
00143     static WT_Result default_process(
00144         WT_Layer & item, 
00145         WT_File & file 
00146         );
00147 };
00148 
00150 
00151 #endif // LAYER_HEADER

Generated on Tue Jan 6 22:41:13 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5