Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

text.h

00001 //  Copyright (c) 1996-2002 by Autodesk, Inc.
00002 //
00003 //  By using this code, you are agreeing to the terms and conditions of
00004 //  the License Agreement included in the documentation for this code.
00005 //
00006 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00007 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00008 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00009 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00010 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00011 //
00012 //  Use, duplication, or disclosure by the U.S. Government is subject to
00013 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00014 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00015 //  Data and Computer Software), as applicable.
00016 //
00017 
00018 #if !defined TEXT_HEADER
00019 #define TEXT_HEADER
00020 
00021 #include "whiptk/text_options.h"
00022 #include "whiptk/drawable.h"
00023 
00028 
00029 
00086 class WHIPTK_API WT_Text : public WT_Drawable
00087 {
00088 private:
00089     WT_Logical_Point                    m_position;
00090     WT_String                           m_string;
00091     WT_Text_Option_Bounds               m_option_bounds;
00092     WT_Text_Option_Overscore            m_option_overscore;
00093     WT_Text_Option_Underscore           m_option_underscore;
00094     WT_Text_Option_Reserved   m_option_reserved;
00095 
00097     enum
00098     {
00099         Getting_Started,
00100         Getting_Position,
00101         Getting_String,
00102         Getting_Overscore,
00103         Getting_Underscore,
00104         Getting_Bounds,
00105         Getting_Reserved,
00106         Getting_Next_Optioncode,
00107         Materializing_Option,
00108         Skipping_Last_Paren,
00109         Completed,
00110         // Obsolete forms of DrawText use the following:
00111         Getting_Width_Scale,
00112         Getting_Spacing,
00113         Getting_Flags,
00114         Getting_Oblique_Angle,
00115         Getting_Rotation,
00116         Getting_Height,
00117         Getting_BBox_Deltas,
00118         Getting_Str_Length,
00119         Getting_Msg
00120     }               m_stage;
00121 
00122     WT_Boolean          m_transformed;
00123     WT_Boolean          m_relativized;
00124     WT_Text_Optioncode  m_optioncode;
00125 
00126     WT_Font *               m_obsolete_font_holder;
00127     WT_Integer32            m_obsolete_length_holder;
00128     WT_Unsigned_Integer16 * m_obsolete_msg_holder;
00129 
00130 public:
00132     WT_Text();
00133 
00135     WT_Text (WT_Text const &);
00136 
00138     WT_Text & operator= (WT_Text const &);
00139 
00141     WT_Text(
00142         WT_Logical_Point const &        position, 
00143         WT_String const &               string, 
00144         WT_Logical_Point const *        bbox, 
00145         WT_Unsigned_Integer16           overscore_count, 
00146         WT_Unsigned_Integer16 const *   overscore_pos, 
00147         WT_Unsigned_Integer16           underscore_count, 
00148         WT_Unsigned_Integer16 const *   underscore_pos 
00149         );
00150 
00152     WT_Text(
00153         WT_Logical_Point const &        position, 
00154         WT_String const &               string 
00155         );
00156 
00158     ~WT_Text();
00159 
00161 
00162     WT_Text_Option_Bounds const &       bounds()     const  {   return m_option_bounds;      }
00164     WT_Text_Option_Overscore const &    overscore()  const  {   return m_option_overscore;   }
00166     WT_Logical_Point const &            position()   const  {   return m_position;         }
00168     WT_String const &                   string()     const  {   return m_string;           }
00170     WT_Text_Option_Underscore const &   underscore() const  {   return m_option_underscore;  }
00172 
00174 
00175     void        de_relativize(WT_File & file);
00177     void        relativize(WT_File & file);
00179     void        transform(WT_Transform const & transform);
00181 
00183     WT_ID              object_id() const;
00184     WT_Result          materialize(WT_Opcode const & opcode, WT_File & file);
00185     WT_Result          process(WT_File & file);
00186     WT_Result          serialize(WT_File & file) const;
00187     WT_Result          skip_operand(WT_Opcode const & opcode, WT_File & file);
00188     virtual void       update_bounds(WT_File * file);
00190 
00192 
00194     static WT_Result default_process(
00195         WT_Text & item, 
00196         WT_File & file 
00197         );
00198 
00199 private:
00200     WT_Result          materialize_obsolete_form(WT_Opcode const & opcode, WT_File & file);
00201 
00202 };
00204 
00205 #endif // TEXT_HEADER

Generated on Tue May 17 12:07:44 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1