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

Between 2 Taps - Tap for Tap interview M...
Hello, and welcome back to Between 2 Taps, Tap for Tap’s Indie Dev interview series. [Read more] | Read more »
Facility 47 (Games)
Facility 47 1.0.1 Device: iOS Universal Category: Games Price: $3.99, Version: 1.0.1 (iTunes) Description: You wake up alone and freezing in an icy cell. You try the cell door but it’s locked, it seems that you are stuck with no... | Read more »
The best Photoshop alternative on iPad
Instagram and Lightroom are great and all, but sometimes people need to get extra creative with their image editing.Like, Photoshop creative. If you're one of these people, take a look at our pick for the best mobile Photoshop experience on iPad... | Read more »
The Walking Dead: No Man’s Land guide -...
A new update for The Walking Dead: No Man’s Land was released last week, making it the perfect time for you to head back to your base and take out some walkers. Here’s the lowdown on what’s new to the game, and how to take advantage. [Read more] | Read more »
Goat Rider guide - Tips and tricks to st...
We've all been there. One second, we're riding high on a crazed goat, and the next, we've been tossed off it like someone who's no good at goat ridin'. [Read more] | Read more »
Real Boxing 2 CREED: How to become a gre...
Just in time for Rocky fans who can’t wait to see CREED, the latest movie, we have the official tie-in game,Real Boxing 2 CREED. It builds on the success of its predecessor and there’s lots to take in so we at 148apps thought we’d run you through... | Read more »
CoinOp Heroes 2 guide - How to build an...
CoinOp Heroes 2 justlaunched and, like all clickers, it's dangerously addictive stuff. You have to furiously tap your screen to defeat wave after wave of foes and earn an insane amount of cash to spend on character upgrades and an army of minions... | Read more »
Dr. Panda Firefighters (Education)
Dr. Panda Firefighters 1.0.1 Device: iOS Universal Category: Education Price: $2.99, Version: 1.0.1 (iTunes) Description: FIGHT FIRES AND SAVE THE DAY!Work together with Dr. Panda and his firefighting team to rescue his trapped... | Read more »
Puddle + (Games)
Puddle + 1.0 Device: iOS iPhone Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: Puddle is back in a new "+" edition featuring enhanced graphics, new videos and Apple TV support ! No IAP and No Ads. Dive into Puddle... | Read more »
Football Manager Mobile 2016 (Games)
Football Manager Mobile 2016 7.0.0 Device: iOS Universal Category: Games Price: $8.99, Version: 7.0.0 (iTunes) Description: Football Manager Mobile 2016 is designed to be played on the move and is the quickest way to manage your... | Read more »

Price Scanner via MacPrices.net

Adorama Black Friday deals: Up to $400 off Ma...
Adorama has released their Black Friday deals for 2015. Save up to $400 on MacBook Pros, $200 on MacBooks and MacBook Airs, and $270 on iMacs. Use code RYBFDEAL during checkout to see these prices.... Read more
B&H Photo Deals: $200 off 12-inch 1.2GHz...
In addition to the B&H Photo Black Friday week sales we posted yesterday, B&H has lowered their price on two products to $200 off MSRP: - 12″ 1.2GHz Gray Retina MacBook: $1399 save $200 - 13... Read more
Best Buy Early Access: Today only, Up to $125...
Best Buy has iPad Air 2s on sale for up to $125 off MSRP and Apple Watch models on sale on their online store for up to $100 off MSRP with special codes through midnight CT tonight. Choose free... Read more
UPPERCASE DESIGNS Premium Ultra Thin Keyboard...
UPPERCASE Designs today announced its new Premium Ultra Thin Keyboard Protector and its Palm Rest Protector Set for the 12-inch MacBook. The accessories provide durable protection for the 12-inch... Read more
Al Jazeera Launches New iOS And Android Mobil...
Doha, Qatar based Al Jazeera has launched new mobile and tablet apps on the iOS and Android systems bringing the latest Al Jazeera news and programmes live together with on-demand personalisation.... Read more
B&H Photo Holiday Sale: Up to $250 off Ma...
B&H Photo has all new Macs on sale for up to $500 off MSRP as part of their Holiday sale including free shipping plus NY sales tax only: - 15″ 2.2GHz Retina MacBook Pro: $1799 $200 off - 15″ 2.... Read more
Free Aura ‘Ultimate’ Mac App For Gmail Update...
Miami, Florida based Crosscoded has announced Aura 1.2.0, an update to the Mac app for Gmail. Aura mixes the power of a native client with the flexibility of the Gmail web app with support for up to... Read more
Apple Will Edge Closer to Samsung in Smartpho...
Total smartphone shipments for 2015 are projected to decline by 9.7% to 1.286 billion units, according to the latest report from global market research firm TrendForce. Though Chinese vendors have... Read more
Sidefari – Split Screen Multitasking In Safar...
Francisco Cantu’s Sidefari is a simple web browser designed to act as a companion to Safari on the iPad. With multitasking in iOS 9, Sidefari uses the new Safari View Controller to show an extra... Read more
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

Jobs Board

*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
Merchant Operations Manager: *Apple* Pay -...
Changing the world is all in a day's work at Apple . If you love innovation, here's your chance to make a career of it. You'll work hard. But the job comes with more than Read more
*Apple* Pay QA Manager - Apple Inc. (United...
Changing the world is all in a day's work at Apple . If you love innovation, here's your chance to make a career of it. You'll work hard. But the job comes with more than Read more
Sr Software Engineer *Apple* Pay - Apple In...
Changing the world is all in a day's work at Apple . If you love innovation, here's your chance to make a career of it. You'll work hard. But the job comes with more than Read more
Hardware Systems Architect - *Apple* Watch...
# Hardware Systems Architect - Apple Watch Job Number: 38449977 Santa Clara Valley, Califo ia, United States Posted: Apr. 16, 2015 Weekly Hours: **Job Summary** The Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.