TweetFollow Us on Twitter


From: jesjones@halcyon.com (Jesse Jones)
Subject: [ANN] Raven 1.2 (Mac C++ framework)

This file contains the source for Raven 1.2 a new C++ framework for
Macintosh programming. Raven is similar to PowerPlant and MacApp but takes
full advantage of newer C++ features, has a more modular structure, and
makes extensive use of programming by contract.

Like ODF and MacApp Raven makes extensive use of multiple inheritance by
means of mixin classes. Raven also uses the standard C++ classes wherever
possible, including the string class, the standard exception classes, and
STL. Raven also makes use of template classes and RTTI.

Raven is divided into four layers: Foundation, Core, Application, and
Esoterica. Each layer is composed of a number of packages. For example the
Core layer has a Files package containing classes to manage things like
reading/writing a file, iterating over files, accessing the Desktop
Manager, and CustomGetFile and CustomPutFile.

The Foundation layer contains low level classes for things like memory
management, debugging, broadcast/listener, exceptions, string utilities,
and geometry classes.

The Core layer includes a large number of generally useful classes for
things like graphics, sound, files, menus, command objects, drag and drop,
preferences, etc.

The Application layer contains higher level classes for views, windows, and
application objects.

The Esoterica layer contains more exotic classes that most applications
won't need. It includes classes for compression (using zlib), finite
automata, regular expressions, parsing, QuickDraw 3D, 2D graphing, 3D
graphing, and mathematics.

Because the lower layers are independant of the higher layers andcoupling
between packages is minimized you can easily use parts ofRaven with other
frameworks. For example, most of the Foundation and Core layers can be used
with PowerPlant.

Raven includes a rich set of debugging tools that include several excellent
debug macros, a powerful debug menu, a framework for developing unit tests,
and a flexible replacement for the default operator new that keeps a stack
crawl for each allocated block.

In addition the member functions in Raven classes do a good job of
verifying the validity of their arguments and many of the classes include
Invariant methods to catch bugs within Raven or within ill behaved

Here are the changes in version 1.2:

Known Bugs:
* Stack crawl doesn't have symbol names if virtual memory is on.
* TStaticText now uses the Appearance Manager if it's installed.
Unfortunately it's ignoring the foreColor in the ControlFontStyleRec record
and appears to always use black (even though Appearance.h says that it
should work).

General Notes:
* Since CW Pro now allows you to precompile the standard C++ headers the
sample projects set PRECOMPILE_RAVEN_HEADERS to 1. However in trying this I
experienced problems stepping into template code that was precompiled...
* Raven has been updated to work with the Appearance Manager. This means
you'll have to weak link to ApperanceLib (if the Appearance Manager isn't
installed Raven will fall back to a System 7 implementation).
* There have been a lot of changes to Raven. I think all the major
changes are mentioned below, but it's possible I missed a few.

Bug Fixes and Design Changes:
* In an effort to be more compatible with STL and to reduce the
neccesity to cast when warn_implicitconv is on I've moved towards using
ulong instead of short or long in the interfaces.
* Raven no longer uses 'STR#' resources to look up strings. Instead
Raven provides LoadRavenString and LoadAppString functions that look up
hard coded strings in a table. For example, instead of something like
LoadIndString(256, 5) you would write LoadAppString("Foo"). LoadAppString
would look up "Foo" in a 'StrM' resource with id 256 and if "Foo" is in the
resource a replacement string would be returned.
* TDocument::HandleSaveAs returns false if there was an error. This way
CanClose will return false giving the user an opportunity to save to a
different drive or to not save at all.
* TWindow::Invariant no longer objects when clicking in title bar of
collapsed window.
* TToolWindow wasn't properly saving the visible flag when it was closed
(so tool windows were always visible when the app was re-launched). This
has been fixed.
* In Raven 1.1 a pane's active attribute worked like the visible
attribute: if the window was active a subpane could be active or inactive.
If the window was inactive all of its subpanes were also inactive. Since
this doesn't seem to make much sense and gave me problems I've changed the
semantics so that panes are always active if the window is active and
always inactive when the window is inactive.
* The applicable pane classes now support the Appearance Manager. This
has entailed some changes:
* Group box no longer supports colors other than gray. Secondary
group boxes are now supported.
* TDisclosureArrow no longer supports medium or large sizes.
* Renamed TCaption TStaticText. Added Enable and Disable methods.
* TScroller::OnActivating and OnDeactivating call the Inherited method.
* TScroller ctors created horz scrollbar if hasVertBar and vice versa.
* TScrollBar uses the original mouse position when deciding where in the
scroll box the user clicked. This way the code works properly on slow
machines with fast mousers.
* Fixed for loop bug in TBaseTableView::GetCellFromPt.
* TControl has members holding the help text for the checked and
disabled states. In earlier versions these were always used. Now
TControl::OnGetBalloonHelp uses TPane's help text if TControl's text is
* TAdorner uses mIndent instead of GetExtent overrides. The GetExtent
override didn't work because TPane overrode RemoveAdorner and called
GetExtent to determine how much to invalidate. Unfortunately RemoveAdorner
was called by the TAdorner dtor which meant the subclasse's GetExtent was
no longer called.
* In Raven 1.1 TTracker did not always call OnTrackContinue. Raven 1.2,
on the other hand, always calls OnTrackContinue at least once. This means
that OnTrackStart should be used only for initialization, OnTrackContinue
should perform the action, and OnTrackStop should handle cleanup.
* TRubberBandTracker no longer caches canvas (didn't work when the view
auto scrolled).
* The TMenu(short, string) ctor was designed to allow you to build menus
by hand. However versions of Raven prior to 1.2 neglected to allocate
mMenuCommands which lead to a crash in short order.
* In Raven 1.1 TFile::Close was documented to not throw an exception and
the dtor called Close. This was done to make it easier to write exception
safe code. For example:
TFile file(spec);

file.Write(buffer.GetPtr(), buffer.GetSize());

If the write failed the file would automatically be closed and because
Close didn't throw we wouldn't have to worry about an exception being
thrown while the stack was being unwound. However because the File Manager
buffers writes FSClose has to flush the buffer which means FSClose may very
well fail. To handle this case Close now throws an exception. The dtor now
ASSERTs that the file is closed and calls Close is it's not (if an
exception was thrown you'll get an ASSERT but the file will be properly
closed). The dtor also traps exceptions. The above code should now be
written as:

TFile file(spec);

file.Write(buffer.GetPtr(), buffer.GetSize());

* FlushVolume throws instead of ASSERTing.
* TFileSpec and TFolderSpec ctors that resolve aliases no longer throw
if the target doesn't exist.
* TFileSpec and TFolderSpec ctors that take strings no longer
automatically convert the string to a valid file name (by replacing colons
with dashes and truncating to 31 characters). Instead they ASSERT that the
string is valid and, if it's not, fix it up.
* MTimer::StartTimer resets mSnapshot (so freq msecs elapse before
OnTime is called). Added MTimer::ResumeTimer (which works like StartTimer
used to).
* MBroadcaster::Broadcast used to stuff the message into a member before
sending it. This was pretty gross, but it made it possible for the
non-template MBaseBroadcaster base class to do all the heavy lifting.
Unfortunately this caused problems when a broadcast caused a broadcast.
This code has been rewritten to be a bit cleaner and to fix this problem.
* The code in ZDisplays.cpp has been revised using the RequestVideo
sample code from Apple. New functions have been added to get and restore
the state of a device. The state includes the Display Manager cookies so it
now restores the device to the exact old state. Also SetDisplayMode now
picks the highest refresh rate.
* Fixed an ASSERT in TMemoryHeap::AddAllocator.
* TSimpleAllocator adjust heap size when allocating huge blocks.
* TRect and TLongRect Pin methods pin to botRight instead of botRight
minus one.
* TLongRect::MapTo uses longs instead of shorts.
* Fixed a bad bug in TQueue::DoExpandBuffer.
* TSetPort no longer crashes if current port is bogus.

* HAS_EXPLICIT and HAS_MUTABLE in RavenHeader.h now default to true (for
CW Pro1).
* RavenHeader.h includes ansi_parms.h
* Added ENABLE_IMPLICIT_CONV_WARNING macro. This is off by default. If
you turn it on ZTypes.h enables the warn_implicitconv warning in the 1.9
compiler. Note that there are parts of Raven that have not been compiled
with this on.
* TApplication::OnCreateDebugCommander is called after OnInit (so the
Debug menu appears after the Windows menu).
* Add a command to the debug menu to show/hide pane invalidations.
* Made some changes to TDocApplication:
* If the option key is down the close command becomes close all and
the save command becomes save all. If the command key is down the close
command becomes junk all.
* Added support for the OS 8 'rapp' apple event.
* Renamed GetFile OnGetFile.
* Made some changes to TDocument:
* HandleSave and HandleSaveAs delete the file if there was an error
writing it out.
* SetDirty and HandleSetDirty now take a data argument (which
defaults to nil). This is broadcast along with the kChangedDocument
* HandleSaveAs won't save over files whose type is not mFileType.
* Volume is flushed after saving.
* SDocumentMessage::document is now a const TDocument pointer.
* Added TDocWindow::Create.
* Made some changes to TWindow:
* mLatentTarget no longer has to be a subpane.
* Removed OnSelect. (This was never called and never made much sense).
* Implemented auto-positioning.
* Added support for opaque panes. A pane is opaque if it's visible and
has an opaque adorner (eg TEraseAdorner) or the mOpaque member is set.
TView::HandleDraw clips any opaque subpanes before drawing itself. This can
significantly reduce flashing.
* TView::OnSubPaneScrolled, OnSubPaneChangedSize, and
OnSubPaneChangedLocation now have a redraw argument.
* Added TScroller::mEraseOnUpdate.
* TStringListBox broadcasts when selection changes or user double clicks.
* Worked on TBaseTableView:
* Made GetRowHeight and GetColWidth public. Made mNumCols and mRows
* Added support for selections.
* Added ScrollIntoView.
* Replaced OnMouseDownCell with OnDoubleClickCell.
* Added TTableSelection, TRowSelection, and TCellSelection.
* Tweaked scroll bar positioning in TListBoxBase. OnMouseDown handles
click after switching target. AdjustScrollBar calls SetPageDelta.
* Changed TScrollableView overhang reconciliation to reduce flashing.
* TCheckBox and TRadioButton support mixed state.
* Added context menus to TColorSwatch.
* DoNote, DoCaution, and DoStop use StandardAlert if it's available.
(They also take a second string).
* TMenuBar uses MenuEvent instead of MenuKey (if Appearance Manager).
* TMenuBar::GetCommandFromKey and DefaultFilterProc use
IsCommandPeriod() (which works with non-US keyboards).
* Removed SCommandStatus::usesMark.
* TContextMenu uses Context Menu Manager if it's installed.
* Added TDragSession::SetClippingPrefix and SetClippingName (which are
used by the OS 8 Finder).
* Made some undo related changes:
* Removed transaction support from TUndoMgr. Added
* Removed Abort methods from TUndoableCommand.
* Added TUndoableCommand::IsValid. Subclasses can override this and
return false when they can no longer do anything useful (TSafePtr (see
below) can help with this).
* TUndoMgr has been updated to delete invalid commands.
* TTracker::OnTrackStop now only has a stopPt argument.
* TStdScoreDeviceFn gives modes at the current resolution a slightly
higher score (this is useful when your app doesn't care what resolution it
runs at).
* FindPreferredDevice short cuts search if current mode suffices.
* TSetPort (GrafPtr) ctor now takes an optional GDHandle.
* Added TColorTable(PaletteHandle).
* Added TPicture::Write. Added a ctor to create a picture from a TGWorld.
* Made some changes to streaming code:
* TOutHandleStream ctor allows clients to specify a reserve size.
* operator))(TInStream, double) byte swaps if neccesary.
* Added stream operators for vector, list, map, and set.
* Added streaming operators to TQueue.
* Added UFileSystem::SpecExists and IsValidName.
* UFileSystem::GetUniqueFile uses SpecExists instead of FileExists.
* TFolderSpec::GetTempFolder and GetTrashFolder allow you to optionally
specify a volume.
* Added assembly glue allowing float to string functions to work with
long doubles.
* TRegularExpression has been reimplemented using finite automata. This
makes matching much faster but constructing the TRegularExpression object
may take a bit longer.
* Renamed EqualReal Equal.
* Abs() functions use intrinsics on PPC.
* Made TVector a template class. Added operator*(T, TVector).
* TPoint and TLongPoint operator (, (=, ), and )= check v first. This
way points can be sorted so that the topLeft points are first and botRight
are last.
* Added TPoint and TLongPoint Distance friend functions.
* PRECONDITION macro casts 'this' to an MInvariant*. This allows the
PRECONDITION and POSTCONDITION macros to be used inside a mixin.
* MBaseEditableObject, MBehaviorableBase, MCommander, and MLockable use
* Added non-virtual Invariant to MCommander.
* Added an Invariant to ZHandleRef. OnLock now adds a tail to the handle.
* Added ulong versions of all the int conversion functions (in
* TAppBootStrap::OnInitSioux now always puts SIOUX on the main monitor
* TSystemException and ThrowIfOSErr use OSStatus instead of OSErr. (Some
of the newer manager return OSStatus. Since this is a long there's a chance
of data loss when using OSErr).
* Added kActivatingWindow and kDeactivatingWindow to TStateBroadcaster.
* Made some changes to the Skeleton project:
* Rewrote Skeleton.r Edit menu balloon help.
* Added a 68K stub to Skeleton project. (This is a tiny 68K app that
tells the user that he need a PPC to run the app).
* Created Debug, Release, and Profile targets in the Skeleton project.
* TMemoryHeap block count functions are defined if !RELEASE (instead of
if DEBUG).
* Added TMemoryHeap::DumpCommonBlocks and DumpAllocatorCapacities. You
can use these to determine if the fixed allocators you're using are still
OK in builds (to do this build a !DEBUG and !RELEASE version of your app
and call DumpCommonBlocks and DumpAllocatorCapacities at the end of main).
* TProfiler uses bestTimeBase instead of microsecondsTimeBase. (This
will cause PPCTimeBase to be used on a PPC which yields much less of a
speed hit than microsecondsTimeBase).
* TProfiler warning for too small numFunctions and stackDepth now
reports correct required values.

* Added SGI STL to Extras. Unlike the MSL in CW Pro1 this library is
exception safe and includes extensive debugging support. It also produces
smaller executables.
* Added ZDialogBoxes.h and cpp which contain functions that make it very
easy to handle simple Quill style input dialogs.
* Added TPatternSwatch. When this is clicked it pops up a menu that
allows the user to pick one of the standard patterns.
* Added TPopupTable. This is a TSimpleTableView that functions like a
popup menu. TPatternSwatch uses this to popup the pattern menu.
* Added TVisualSeparator. This is a simple divider line that works
correctly with the Appearance Manager.
* Added TPicturePane.
* Added TStandardGetFile, TStandardGetFileOrFolder, and
TStandardPutFile. These provide a framework for easily extending a custom
standard file dialog with filter and hook functions.
* Added an Automata folder to Esoterica. This contains deterministic and
non-deterministic finite automata classes.
* Brand new parser classes have been added to Esoterica:Parser. These
classes provide a powerful framework for implementing recursive descent
parsers. (The old TParser class has been renamed TSimpleParser and can
still be useful for simple jobs).
* Added THSVColor.
* Added a templatized 2D array called TArray. (This is a generic array,
if you're storing floats you probably want to use TMatrix).
* Added a sparse templatized 2D array called TSparseArray.
* Added TSet. This is a wrapper around STL's set class that behaves more
like a set in mathematics. For example you can get the intersection of two
sets by typing s1 & s2 and you can add a new element with s1 += elem.
* Added TSafePtr. This is a smart pointer class that gets notified when
its target is destroyed. You can check to see if the pointer is OK to use
by calling the TargetExists method.
* Added a template TComplex class. This is similar to the standard's
complex class except that it provides direct access to the real and
imaginary members.
* Added xdouble. This is the long double class from the LiDIA math package.
* Added int and double versions of Random.

-- Jesse (jesjones@halcyon.com)


Community Search:
MacTech Search:

Software Updates via MacUpdate

Bookends 12.6.0 - Reference management a...
Bookends is a full-featured bibliography/reference and information-management system for students and professionals. Access the power of Bookends directly from Mellel, Nisus Writer Pro, or MS Word (... Read more
Apple iBooks Author 2.4 - Create and pub...
Apple iBooks Author helps you create and publish amazing Multi-Touch books for iPad. Now anyone can create stunning iBooks textbooks, cookbooks, history books, picture books, and more for iPad. All... Read more
Web Snapper 3.3.9 - Capture entire Web p...
Web Snapper lets you capture Web pages exactly as they appear in your browser. You can send them to a file as images or vector-based, multi-page PDFs. It captures the whole Web page - eliminating the... Read more
Tunnelblick 3.6beta10 - GUI for OpenVPN...
Tunnelblick is a free, open source graphic user interface for OpenVPN on OS X. It provides easy control of OpenVPN client and/or server connections. It comes as a ready-to-use application with all... Read more
EtreCheck 2.5.1 - For troubleshooting yo...
EtreCheck is a simple little app to display the important details of your system configuration and allow you to copy that information to the Clipboard. It is meant to be used with Apple Support... Read more
Paragraphs 1.0.4 - Writing tool just for...
Paragraphs is an app just for writers. It was built for one thing and one thing only: writing. It gives you everything you need to create brilliant prose and does away with the rest. Everything in... Read more
Things 2.8 - Elegant personal task manag...
Things is a task management solution that helps to organize your tasks in an elegant and intuitive way. Things combines powerful features with simplicity through the use of tags and its intelligent... Read more
Coda 2.5.12 - One-window Web development...
Coda is a powerful Web editor that puts everything in one place. An editor. Terminal. CSS. Files. With Coda 2, we went beyond expectations. With loads of new, much-requested features, a few surprises... Read more
PCalc 4.3 - Full-featured scientific cal...
PCalc is a full-featured, scriptable scientific calculator with support for hexadecimal, octal, and binary calculations, as well as an RPN mode, programmable functions, and an extensive set of unit... Read more
DiskMaker X 5.0 - Make a bootable OS X i...
DiskMaker X (was Lion DiskMaker) helps you to build a bootable drive from the official OS X installer app (the one you download from the Mac App Store). It detects the OS X Install program with... Read more

Camel Up (Games)
Camel Up 1.0.0 Device: iOS Universal Category: Games Price: $4.99, Version: 1.0.0 (iTunes) Description: | Read more »
The Martian: Bring Him Home (Games)
The Martian: Bring Him Home 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: Based on the best selling novel and critically acclaimed film, THE MARTIAN tells the story of Astronaut Mark... | Read more »
This Week at 148Apps: September 21-30, 2...
Leap Into Fall With 148Apps How do you know what apps are worth your time and money? Just look to the review team at 148Apps. We sort through the chaos and find the apps you're looking for. The ones we love become Editor’s Choice, standing out above... | Read more »
Tweetbot 4 for Twitter (Social Networki...
Tweetbot 4 for Twitter 4.0 Device: iOS Universal Category: Social Networking Price: $4.99, Version: 4.0 (iTunes) Description: *** 50% off for a limited time. *** | Read more »
Mori (Games)
Mori 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: Stop, rewind and unwind with Mori. Time is always running, take a moment to take control. Mori is an action puzzle game about infinitely... | Read more »
100 Years' War (Games)
100 Years' War 1.0 Device: iOS Universal Category: Games Price: $3.99, Version: 1.0 (iTunes) Description: | Read more »
Tower in the Sky (Games)
Tower in the Sky 0.0.60 Device: iOS Universal Category: Games Price: $1.99, Version: 0.0.60 (iTunes) Description: | Read more »
hocus. (Games)
hocus. 1.0.0 Device: iOS Universal Category: Games Price: $.99, Version: 1.0.0 (iTunes) Description: New, polished, mind-bending, minimal puzzle game with dozens of levels and extra-ordinary design Features:- Beautifully crafted... | Read more »
Mos Speedrun 2 (Games)
Mos Speedrun 2 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: Mos is back, in her biggest and most exciting adventure ever! Wall-jump to victory through 30 mysterious, action packed levels... | Read more »
3D Touch could be a game-changer, but it...
Were you one of the lucky/financially secure enough ones to buy a new iPhone 6s or iPhone 6s Plus over the weekend? Yup, me too (I’m not convinced I was either of those two things, but let’s go with lucky for now), so I thought I’d delve into just... | Read more »

Price Scanner via MacPrices.net

12-inch MacBooks in stock for up to $120 off,...
Adorama has 12″ Retina MacBooks in stock for up to $120 off MSRP including free shipping plus NY & NJ sales tax only. For a limited time, Adorama will include a free Apple USB-C to USB Adapter,... Read more
15-inch 2.2GHz Retina MacBook Pro on sale for...
Amazon.com has the 15″ 2.2GHz Retina MacBook Pro on sale for $1799 including free shipping. Their price is $200 off MSRP, and it’s the lowest price available for this model (except for Apple’s $1699... Read more
iPhone 6s and 6s Plus Feature Improved Durabi...
Upgraded components in the new iPhone 6s Plus cost $16 more than the components in the earlier iPhone 6 Plus according to a preliminary estimate from IHS Inc. The bill of materials (BOM) for an... Read more
13-inch Retina MacBook Pros on sale for up to...
Adorama has 13″ Retina MacBook Pros on sale for up to $130 off MSRP. Shipping is free, and Adorama charges sales tax for NY & NJ residents only: - 13″ 2.7GHz/128GB Retina MacBook Pro: $1199.99 $... Read more
Apple refurbished 2014 13-inch Retina MacBook...
Apple has Certified Refurbished 2014 13″ 2.6GHz/128GB SSD Retina MacBook Pros available $979, $320 off original MSRP. An Apple one-year warranty is included, and shipping is free: - 13″ 2.6GHz/128GB... Read more
iOS 9 Reflections Ten Days In – The ‘Book Mys...
I’ve never been much of an early adopter by philosophy or temperament, although I did buy the iPad Air 2 I’m typing this column on last fall only about a month after Apple unveiled it. However, my... Read more
Apple refurbished Time Capsules available for...
Apple has certified refurbished Time Capsules available for $120 off MSRP. Apple’s one-year warranty is included with each Time Capsule, and shipping is free: - 2TB Time Capsule: $179, $120 off - 3TB... Read more
OS X El Capitan Available as a Free Update To...
OS X El Capitan, the latest major release of Apple’s desktop operating system, is available today, September 30 as a free update for Mac users. “People love using their Macs, and one of the biggest... Read more
15-inch Retina MacBook Pros on sale for $150-...
B&H Photo has 2015 15″ Retina MacBook Pros on sale for up to $200 off MSRP including free shipping plus NY sales tax only: - 15″ 2.2GHz Retina MacBook Pro: $1815 $184 off - 15″ 2.5GHz Retina... Read more
Updated For iOS 9, InterConneX Lets You Store...
InterConneX version 1.2 is now a 64-bit app that’s completely compatible with iOS 9. InterConneX is a file storage, file management, and file sharing app for the iPhone or iPad that now takes... Read more

Jobs Board

*Apple* Systems Engineer (Mclean, VA and NYC...
Title: Apple Systems Engineer (Mclean, VA and NYC)Location: United States-New York-New York-NYC 200 Park Avenue (22005)Other Locations: United Read more
*Apple* Retail - Multiple Positions (US) - A...
Job Description:SalesSpecialist - Retail Customer Service and SalesTransform Apple Store visitors into loyal Apple customers. When customers enter the store, you're Read more
*Apple* Retail - Multiple Customer Support P...
Job Description:Customer SupportSpecialist - Retail Customer Service and SalesTransform Apple Store visitors into loyal Apple customers. When customers enter the Read more
*Apple* Solutions Consultant - Retail Sales...
**Job Summary** As an Apple Solutions Consultant (ASC) you are the link between our customers and our products. Your role is to drive the Apple business in a retail Read more
SW QA Engineer - *Apple* TV - Apple (United...
**Job Summary** The Apple TV team is looking for experienced Quality Assurance Engineers with a passion for delivering first in class home entertainment solutions. **Key Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.