Previous | Next Licensing |
I | Overview of WTextOriginally by Timothy Paustian, now being maintained by David Phillip Oster current code version 1.0.3a3 - All seems to be working correctly and the new release is backwards compatible with WASTE v 1.3IntroductionWTextView and WText are Power Plant and C++ wrappers classes for the Worldscript Aware Styled Text Engine (WASTE) version 2.0 and higher. As an extra bonus, the WText and WTextView classes are now carbonized and work with OS X. WASTE is written and maintained by "Marco Piovanelli". This wrapper replaces CWASTEEdit, which is discontinued. Project PageSourceForge is hosting the project page, and the CVS page for WTextView. Code DownloadYou can download the WText package and the old CWASTEEdit package for free. The license for the WText package is listed on the Licensing page. Note that the use of CWASTEEdit is in maintenance mode, since WText now supports WASTE 1.3 I, Timothy Paustian, see no reason people should use it. More information about CWASTEEdit can be found at the Original WText home page. Why a new class?First, I, Timothy Paustian, have always hated the name CWASTEEdit - really. When Marco came out with WASTE 2.0 it was going to require some major modifications to the PowerPlant wrapper and I decided to start fresh and use what I have learned in the past few years to improve the design. So what are the improvements?CWASTEEdit was split into two classes; WText, which wraps all the public WASTE calls and maintains the WEReference handle and WTextView, a PowerPlant view which inherits from WText and implements the interface between WASTE and PowerPlant. WTextThis is a simple class that has one class member, mWasteH, a reference to the WASTE data for the class. All of the public WASTE calls are implemented in WText. Most of the member functions are declared inline for speed and basically just pass the call along to the WASTE engine. For example here is the call for setting the destination rectangle for the WASTE instance. inline void WText::SetDestRect( LongRect inDestRect) { WESetDestRect(inDestRect, mWasteH); } This makes it easy to call all of the public functions in WASTE using a C++ pointer. Some things to remember about WText.
WTextViewWTextView is the Power Plant specific implementation of WText. It manages the necessary interaction between WASTE and Power Plant. A WTextView can be created using streams defined in a PPob resource, using a copy constructor, or with input parameters. The default constructor does work, but its use is not recommended. WTextView inherits from LView, LCommander, LPeriodical, LDragAndDrop, WText and LBroadcaster.
AppleScript SupportThe text model for apple script is implemented in a separate hierarchy and is optional. The programmer exercises this choice by filling a member variable in WTextView (mTextModel) that points to the top text model class by calling the functions SetTextModel. For more details about the new Apple Script classes that ships with WText see the apple script page. Now, lets get started with WText. <to Quick Start> Important links |
Originally by Timothy Paustian. Last modified September 17, 2002. Contact David Phillip Oster <mailto:oster@ieee.org>.