text.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 
00019 #if !defined TEXT_HEADER
00020 #define TEXT_HEADER
00021 
00025 
00026 #include "whiptk/text_options.h"
00027 #include "whiptk/drawable.h"
00028 
00033 
00034 
00090 class WHIPTK_API WT_Text : public WT_Drawable
00091 {
00092         friend class WT_W2D_Class_Factory;
00093         friend class WT_Opcode;
00094 
00095 private:
00096     WT_Logical_Point                    m_position;
00097     WT_String                           m_string;
00098     WT_Text_Option_Bounds               m_option_bounds;
00099     WT_Text_Option_Overscore            m_option_overscore;
00100     WT_Text_Option_Underscore           m_option_underscore;
00101     WT_Text_Option_Reserved   m_option_reserved;
00102 
00104     enum
00105     {
00106         Getting_Started,
00107         Getting_Position,
00108         Getting_String,
00109         Getting_Overscore,
00110         Getting_Underscore,
00111         Getting_Bounds,
00112         Getting_Reserved,
00113         Getting_Next_Optioncode,
00114         Materializing_Option,
00115         Skipping_Last_Paren,
00116         Completed,
00117         // Obsolete forms of DrawText use the following:
00118         Getting_Width_Scale,
00119         Getting_Spacing,
00120         Getting_Flags,
00121         Getting_Oblique_Angle,
00122         Getting_Rotation,
00123         Getting_Height,
00124         Getting_BBox_Deltas,
00125         Getting_Str_Length,
00126         Getting_Msg
00127     }               m_stage;
00128 
00129     WT_Boolean          m_transformed;
00130     WT_Boolean          m_relativized;
00131     WT_Text_Optioncode  m_optioncode;
00132 
00133     WT_Font *               m_obsolete_font_holder;
00134     WT_Integer32            m_obsolete_length_holder;
00135     WT_Unsigned_Integer16 * m_obsolete_msg_holder;
00136 
00137 public:
00139     WT_Text();
00140 
00142     WT_Text (WT_Text const &);
00143   
00144 
00146     WT_Text(
00147         WT_Logical_Point const &        position, 
00148         WT_String const &               string, 
00149         WT_Logical_Point const *        bbox, 
00150         WT_Unsigned_Integer16           overscore_count, 
00151         WT_Unsigned_Integer16 const *   overscore_pos, 
00152         WT_Unsigned_Integer16           underscore_count, 
00153         WT_Unsigned_Integer16 const *   underscore_pos 
00154         );
00155 
00157     WT_Text(
00158         WT_Logical_Point const &        position, 
00159         WT_String const &               string 
00160         );
00161 
00163     virtual ~WT_Text();
00164 public:
00165 
00167     WT_Text const & operator= (WT_Text const &);
00168 
00170 
00172     WT_Text_Option_Bounds const &       bounds()     const  {   return m_option_bounds;      }
00173     WT_Text_Option_Bounds       &       bounds()            {   return m_option_bounds;      }
00174 
00176     WT_Text_Option_Overscore const &    overscore()  const  {   return m_option_overscore;   }
00177     WT_Text_Option_Overscore       &    overscore()         {   return m_option_overscore;   }
00178 
00180     WT_Logical_Point const &            position()   const  {   return m_position;         }
00181     WT_Logical_Point       &            position()          {   return m_position;         }
00182 
00184     WT_String const &                   string()     const  {   return m_string;           }
00185     WT_String       &                   string()            {   return m_string;           }
00186 
00188     WT_Text_Option_Underscore const &   underscore() const  {   return m_option_underscore;  }
00189     WT_Text_Option_Underscore       &   underscore()        {   return m_option_underscore;  }
00191 
00193 
00194     virtual void        de_relativize(WT_File & file);
00196     virtual void        relativize(WT_File & file);
00198     virtual void        transform(WT_Transform const & transform);
00200 
00202     WT_ID              object_id() const;
00203     WT_Result          materialize(WT_Opcode const & opcode, WT_File & file);
00204     WT_Result          process(WT_File & file);
00205     virtual WT_Result  serialize(WT_File & file) const;
00206     WT_Result          skip_operand(WT_Opcode const & opcode, WT_File & file);
00207     virtual void       update_bounds(WT_File * file);
00209 
00211 
00213     static WT_Result default_process(
00214         WT_Text & item, 
00215         WT_File & file 
00216         );
00217 
00218 private:
00219     WT_Result          materialize_obsolete_form(WT_Opcode const & opcode, WT_File & file);
00220 
00221 };
00223 
00224 #endif // TEXT_HEADER

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