Site icon MacTech.com

[MD1] Raven 1.4

Raven is a C++ application framework that is, IMO, in many ways superior to
both PowerPlant and MacApp. It’s free and source code is included. You can
find Raven at:

(ftp://ftp.halcyon.com//pub/users/jesjones/Raven 1.4.sit)
(ftp://ftp.halcyon.com//pub/users/jesjones/Raven 1.4 Examples.sit)

The changes in Raven 1.4 are listed below.

Jesse Jones
jesjones@halcyon.com

Known Bugs:

* Stack crawl doesn’t have symbol names if virtual memory is on.

* DTS has confirmed a bug in the 1.0.1 Appearance Extension: if a window’s
procID is kWindowModalDialogProc or kWindowAlertProc the window is not
actually modal (ie the user can switch out of the app).

General Notes:

* This release of Raven requires CodeWarrior Pro 3 (there were too many
changes required to stay compatible with Pro 2). To port your old Raven
code to 1.4 you’ll need to do the following:

* Make you code namespace savvy. The easiest way to do this is
to add the following to your headers:

using namespace Raven;
using namespace std;

* Be sure to put Raven and standard library forward references
inside a namespace declaration:

namespace Raven {
class TInStream;
class TOutStream;
}

* You may have trouble using operator!= with strings. If this
happens write the comparison like this:

if (!(str1 == str2))

* Include a few new files in your project. These include
ZStreaming.cpp, MoreFilesCW.PPC, and the extension classes
(these are spread out into the Extensions, Pane, and App folders).

Bug Fixes and Design Changes:

* TDocApplication and TDocument have been changed so that they clearly
delineate between creating a new document and opening an old document:

* HandleNew and OnNew methods have been added to TDocument.

* HandleNew, OnNew, OnOpen, OnCreateNewDoc, and OnCreateOldDoc
methods have been added to TDocApplication.

* OnCreateDoc and OnOpenDoc have been obsoleted (they’re still
defined, but with different signatures so the compiler should
inform you where you need to make changes).

* In Raven 1.3 there were three mixin classes that allowed you to change
the behavior of an object at run time: MAdornable, MBehaviorable, and
MAtributable. In Raven 1.4 these are gone. Instead there’s a single mixin
called MExtensible which allows you to attach arbitrary extension objects.
If you’re attaching adorners using Quill your old code will continue to
work. If you’re doing this stuff at run time you’ll have to do a bit of
renaming.

* The Debug menu is now handled using debug extensions. You can override
TApplication:: OnCreateDebugExtensions to change which extensions are used
or to add your own extensions. You can also add and remove debug extensions
dynamicly.

* The TMenu and TMenuBar classes have been largely rewritten. This was done
to make it possible for submenus to be added and removed at run time. Most
of this is transparent to clients, but there are a few things that may
affect you:

* TMenu::AddItem has been renamed AppendItem.

* You should not use TMenu::AppendItem or InsertItem to add
seperator lines. Instead use the new AppendSeperator and
InsertSeperator methods.

* RemoveEveryItem has been replaced by DeleteItems.

* Renamed TMenuBar::RemoveMenus DeleteMenus.

* TMenuBar::GetMenuByIndex no longer returns submenus.

* Worked on error handling:

* ReportError has been changed to better match the new StandardAlert
convention of breaking the message into a summary and a narrative section.
If you call ReportError you should make sure the second string is a
complete sentence (see ZMiscUtils.h for examples).

* DefaultErrorHandler uses a new alert on system’s without
the Appearance Manager.

* Rewrote many of the strings in the error code to string
mapping in the ‘STRX’ resource (Raven.r).

* ZMiscUtils.h allows you to replace the function used to
map error codes to strings.

* TApplication::OnUncaughtException says “Couldn’t complete
the operation.” instead of “Unknown error”.

* Revised all the throw statements to conform to the new guidelines.

* Revised calls to ReportError to conform to new guidelines.

* TWindow now uses the correct brushes for alert and floating windows.

* TWindow::OnBroadcast doesn’t set the latent target if the new pane is a
pane that isn’t a subPane of the window.

* Fixed TBuildWindowRegions so that it works on 68K’s.

* TWindowMenuMgr only enables tool window menu items if they can operate on
the front regular window.

* TView::DoGetOpaqueSubPanes uses GetVisibleExtent (so, for example, text
boxes in Quill clip correctly).

* Fixed ZScrollerScrollBar::GetPageDelta to work properly when scroll units
isn’t one.

* Fixed TScrollableView::DoScrollBits so that it works when the pane’s
window is behind another window (eg the window being scrolled might be
behind a floater).

* Fixed several problems with scrolled table views (thanks to Ron Wilson).

* The examples and T2DGraph::OnMouseDown check for the Drag Manager before
calling WaitMouseMoved.

* MDragSource::OnDragStop calls MDragTarget::StoppingDrag even if the drag
didn’t succeed.

* Pane adorners are now clipped to the pane’s superView instead of to the
pane (this allows adorners like TFocusRectAdorner to safely draw outside
the lines).

* Fixed MCommander::HandleMenuCommand TRACEFLOW (it was printing a string
as an int).

* TFile::Seek uses an int32 for offset (instead of a uint32).

* Updated UNavigationServices for (yet more) changes to the SDK:

* Put the NavPutFile arguments in the correct order.

* GetFile and PutFile no longer throw if the user cancels (Nav
Services now returns userCanceledErr when the user cancels).

* NavGetFile 1.0f4c3 will crash if the current port is bad so
I’m setting the port to the work port before popping up Nav
dialogs.

* TInHandleStream::OnReadBytes throws a TRuntimeException instead of a string.

* Fixed ushort input streaming operator to use the correct tag.

* Implemented TPictInitter::OnInit.

* ZPictureRef::DoInit sets the current port to the work port (GetPictInfo
will crash if the port is bad).

* Fixed an off by one error in T3DHitPath ctor.

* T3DPoint no longer supports ( or ) operators. T3DRect::operator&=
correctly returns kZero3DRect if the rectangles don’t intersect.

* TRegion::Contains(TRect) now returns true only if the rectangle is
entirely within the region. (It used to return true if the corners were
inside the region).

* Added a missing comma to the string table in Z3DUtils.cpp

* TRsrcSound and TRawSound use ldtox80 instead of dtox80 (which isn’t in
MathLib v1).

* TRawSound takes a double for sample rate (old code used an UnsignedFixed
and didn’t work with 44 kHz). The old ctor was made private so you should
get a compiler error wherever your code needs to be updated.

* Some of the TArray ctors used to allocate mElements as an array of uint8
and used uninitialized_fill to fill it up. This was causing problems with
CW Pro 2 when T was a struct (because of padding?) so it now only allocates
arrays of T.

* TMemoryHeap::GetHeapSize used to include huge blocks (ie large blocks
allocated with NewPtr and never suballocated from). This was a Bad Thing
because it made it very difficult to know how large to make the object
heap. Now GetHeapSize only returns the sum of the object heap pools and new
GetHugeBytes and GetHugeHighwater methods have been added (the Dump Object
Heap command in the Debug menu has been updated to call these).

* Fixed some problems when ASSERTS_THROW is defined in ZPurgeableList and
THandle.

* MInvariant::Invariant no longer fires on 68K’s.

* Stack crawl code checks unmangle’s return code.

Changes:

* Tweaked “Mixing Raven and PowerPlant” doc.

* TApplication::Run has been deprecated: HandleEventLoop should be used
instead.

* TApplication maintains a 64K reserve block that will be purged by the new
TGrowZone class. If this happens the app is considered to be low on memory
and TApplication will pop up an alert and TDocApplication will disable the
new and open commands. If your app has commands that allocate non-trivial
amounts of memory you should disable them if memory is low. You can tweak
the size of the reserve block and the amount of additional memory required
before the reserve block is reallocated by changing mReserveSize and
mReserveBuffer.

* Added TDropApp::HandleIdle (called when there aren’t any events in the
event queue).

* TDropApp will use Nav Services if USES_NAV_SERVICES is set.

* Added TDocument::OnRevert.

* Tweaked TDocument::ForceClose to work properly when ref count is zero
(this should be a fairly unusual case).

* TWindow ctors add the window to the state broadcaster’s listeners.

* TWindow will handle window repositioning if the modeDisplayManagerAware
SIZE flag is set.

* Added TToolWindow::OnRetarget.

* Added TView::iterator typedef.

* Made TPane::Invalidate() virtual and changed OnSetSize to allow for panes
that draw outside the lines.

* TPicturePane and TPushButton override Invalidate().

* Made some changes to TCachedView:

* Instead of using a fixed depth you can tell TCachedView to
use the deepest or maximum device the view intersects.

* The cache can now be purged when memory runs low. (This is
off by default).

* modeDisplayManagerAware requires that the
modeDisplayManagerAware SIZE flag be set.

* Changed TScrollBar implementation to support 32-bit values.

* TScroller::GetContentExtent no longer uses hard coded constants. Renamed
AdjustScrollBars DoAdjustScrollBars. Made DoMakeVertScrollBar and
DoMakeHorzScrollBar virtual.

* TScroller no longer hides scrollbars when deactivating.

* TScrollableView::OnScrollTo only calls DoScrollBits if both the horz and
vert deltas are less than the pane size (instead of either).

* TColorSwatch broadcasts when the user changes the color.

* TDrawExtension::mIndent is a TRect instead of TPoint.

* TDrawExtension::DrawsBeforeOwner is no longer virtual.

* Draw extensions can now draw before or after their owner.

* TPortCanvas ASSERTs that calls to BeginDraw aren’t nested (this can cause
problems since the original port won’t be restored).

* TStandardGetFile and UNavigationServices filter functions resolve aliases
using kARMNoUI.

* Removed TDocApplication::mOpenMultipleFiles and mEnablePreview (use
mNavOpenOptions instead).

* UStandardFile::GetFile methods now have an optional prompt.

* Object streaming now supports circular object graphs (thanks to Eric
Berdahl).

* Moved global stream operators from ZStream.h to ZStreaming.h.

* The Files package now uses MoreFiles for most of the heavy lifting.

* TFileSpec::::GetParent again returns a TFolderSpec (this can be forward
referenced in the header since it’s not actually used).

* Removed TQ3Point3D, TQ3ColorRGB, and TQ3ColorARGB streaming operators.

* Added T2DPoint, T2DRect, T2DVector, T3DVector, T3DColorRGB and
T3DColorARGB streaming operators.

* Added T2DSize.

* T3DColorRGB scalar operators take doubles instead of floats.

* Instead of ASSERTing that dot product is in [-1, +1] T2DVector and
T3DVector::Angle methods use MinMax to force it into the valid range (due
to rounding errors the ASSERT would fire occasionally).

* THSVColor(RGBColor), TRGBColor(HSVColor), and T3DRGBColor(HSVColor) no
longer use the toolbox to perform the conversions (because the toolbox
routines are very slow).

* Removed divisions from Equal(double, double, double).

* THandle now adds the tail when a ZHandleRef is created. SetSize zaps new
data when expanding (if debug). Replaced Handle conversion operator with
GetHandle accessor.

* TPointer no longer has a ctor taking a Ptr. SetSize zaps new data when
expanding (if debug).

* Added GetFloat to ZInput and ZDialogBoxes. Renamed GetShort GetInt16,
GetLong GetInt32, and GetULong GetUint32.

* TSIOUXExtension only enables kCopyCmd when SIOUX has text selected.

* Added missing call to IsTagged to operator(( (int).

* UPreferences::Read no longer creates the pref file (so the pref file
won’t be created until something is actually written out).

* TBootStrap::HandleSystemCheck uses a better message when a required
extension can’t be found.

* #pragma scheduling is now only used within #if __POWERPC__.

* TStateBroadcaster broadcasts kMovedWindow, kResizedWindow,
kDeviceChanged, kDesktopChanged, kMemoryWentLow, and kMemoryWentHigh.

* UPreferences hard codes file type to ‘pref’ and creator to ‘????’ (as per
TN 1126).

* ZNewAndDelete.cpp defines the nothrow version of operator new (if
RAVEN_OPERATOR_NEW is non-zero). This was disabled in Raven 1.3 because the
linker used to issue a warning.

* ZNewAndDelete.cpp also now defines the array versions of operator new and
delete.

* Enabled override of nothrow version of operator new.

* GaussianRandom no longer returns values outside [-1, 1].

* GetMicroSeconds and GetMilliSeconds use David Lawrence’s fast
microseconds code.

* Turned optimizations off for BreakStrToDebugger (Pro 3 compiler bug).

* Turned off Copy/Const Propagation optimizer setting in all projects
(optimizer bug).

* Removed some work arounds required by the beta Pro 3 compilers.

* Replaced zlib 1.0.4 with zlib 1.1.2

* Example projects include MSLstring.cpp (unless you’re using iostream’s
you can include this in place of the bloated C++ library).

* Removed *Extras* folder.

* Added Third Party folder for stuff like ODMemMgr and zlib.

* Pro 3 still has problems with access control. For example, subclasses can
use their base classes’ Inherited typedef. In an attempt to minimize the
ugliness that this can cause I went through all the code and added
Inherited typedefs to any classes that were missing them. The regular
expression I used is: “class[ \n\t\r]+[A-Za-z_][A-Za-z0-9_]*[ \n\t\r]*:[
\n\t\r]*(((public)|(protected)|(private))[
\n\t\r]+[A-Za-z0-9__][A-Za-z0-9_()]*[ \n\t\r]*(,[ \n\t\r]*)?)+{[
\n\t\r]+((//)|p)”

Additions:

* Added TGrowZone and MPurgeable.

* Added missing TToolWindow::Create method.

* Added TIconPane, TChasingArrows, TProgressBar, and TIndeterminateBar.

* Added TMenuExtension (allows you to change the way an MCommander responds
to a menu command).

* Can now dump pane hierarchy and command chain from the Debug menu.

* Added a debug extension that will fill dirty update regions with bright
red before redrawing panes.

* Added T2DGraph::HasPlot.

* Added __PreInit__ function and an ExitToShell patch to ZBootstrap.cpp
(for 68K apps).

* Added UNavigationServices::ChooseObject. Added
SNavOptions::SetActionButtonLabel and SetCancelButtonLabel.

* Added default ctors for TNavOpenReply and TNavSaveReply.

* Added UFileSystem::ResolveAlias and IsAliasFile methods.

* Added UFileSystem::CopyFile, IsLocked, GetVolumeTotalBytes, and
IsVolumeLocked.

* Added UDesktopMgr::SetComment.

* Added TRect and TLongRect::GetCenter.

* Added TStartAverageTimer – stack based class used to enable and disable a
TAverageTimer.

* Added UGestalt::HasMacTCP, HasOpenTransport, and GetOpenTransportVersion.

* Added uint8_cast, int8_cast, uint16_cast, etc to ZNumbers.h. These are
inline template functions that ASSERT that their argument is in range and
then do a cast.

* Added long long streaming operators.

* Added long long byte swapping.

* Added TRegion::IsRectangle.

* Added kPi, kHalfPi, and kTwoPi constants to ZNumbers.h

* Added COMPILE_CHECK. This is an ASSERT that works at compile time.

* Added CHECK_INVARIANT macro.

Quill:

* When Quill creates TToolWindow’s it now sets the showNew flag to false.

* TPicturePane editor no longer objects if picture id is -1 (this means
that the picture doesn’t have PICT and one will have to be installed
programatically).

* Fixed a bug that occurred when using the clear command on resources (this
was introduced when I switched over to using unsigned ints).

* Fixed a simple bug that prevented new ‘View’ resources from being
created. (This was introduced in 1.3)

* “(0 for default)” caption in text traits editor was using a bogus text
trait id.

* Added a warning to Quill and ZHelpMessage.h mentioning that PICT balloons
will not be supported in Carbon.

* Added a draw extension showing pane indices. Added context menu for
moving a pane to the front or to the back of it’s view’s list of subPanes.

* Tweaked pane editors so that focus rects no longer get drawn over by
other panes.

* Made pane edit dialog a bit wider.

* TStaticText editor text entry pane is much larger.

* Quill uses Nav Services.

* Release build now defines ASSERTS_THROW.

* New TPicturePane’s start out as 64×64 instead of 200×200 pixels.

Exit mobile version