[MD1]
TweetFollow Us on Twitter

[MD1]

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
subclasses.

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
empty.
* 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.Open(fsWrPerm);

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.Open(fsWrPerm);

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

file.Close();
}
* 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.

Changes:
* 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
message.
* 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
protected.
* 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
TMultipleUndoableCommand.
* 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
PRECONDITION and POSTCONDITION macros.
* 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
ZIntConversions.h).
* 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.

Additions:
* 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

Latest Forum Discussions

See All

Players can take a peek into the design...
It doesn’t matter how much effort developers put into their classes, or how many special little mechanics there are; if there is one that wields two blades, I’m ignoring everything else. Diablo Immortal recently announced such a class in the shape... | Read more »
Android users have a new option in the c...
When you are in the thick of a firefight or trying to pull off a mid-combat parkour flip through a squad of foes, sometimes touchscreen control just won’t do it for you. For those intense sessions, you could benefit from a good mobile controller,... | Read more »
Jagex releases the first of three origin...
At this point, I am sure everyone has heard of Runescape, and or Runescape Classic. It has been going strong for 23 years, with constant content and story coming out. Luckily for fans of the game, or fantasy in general, Jagex has announced an... | Read more »
Watcher of Realms unveils new story and...
Watcher of Realms players are in for quite the feast this month, as Moonton release two powerful new heroes, including one that will burst down even the most mighty of foes. Recruit your new friends, and then burn through the Main Quest expansion... | Read more »
Reverse: 1999 continues its trip down un...
The field trip to Australia continues in Reverse: 1999 as Phase 2 of Revival! The Uluru Games kicks off. You will be able to collect new characters, engage with new events, get hordes of free gifts, and follow the story of a mushroom-based... | Read more »
Ride into the zombie apocalypse in style...
Back in the good old days of Flash games, there were a few staples; Happy Wheels, Stick RPG, and of course the apocalyptic driver Earn to Die. Fans of the running over zombies simulator can rejoice, as the sequel to the legendary game, Earn to Die... | Read more »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »
Netflix Games expands its catalogue with...
It is a good time to be a Netflix subscriber this month. I presume there's a good show or two, but we are, of course, talking about their gaming service that seems to be picking up steam lately. May is adding five new titles, and there are some... | Read more »
Pokemon Go takes a step closer to real P...
When Pokemon Go was first announced, one of the best concepts of the whole thing was having your favourite Pokemon follow you in the real world and be able to interact with them. To be frank, the AR Snapshot tool could have done a lot more to help... | Read more »
Seven Knights Idle Adventure drafts in a...
Seven Knights Idle Adventure is opening up more stages, passing the 15k mark, and players may find themselves in need of more help to clear these higher stages. Well, the cavalry has arrived with the introduction of the Legendary Hero Iris, as... | Read more »

Price Scanner via MacPrices.net

Weekend Deal! Best Buy has Apple Watch Series...
Best Buy has Apple Watch Series 9 models on sale for $100 off MSRP on their online store this weekend. Sale prices available for online orders only, in-store prices may vary. Order online, and choose... Read more
Apple Watch SE on sale starting at $199 this...
Best Buy has all Apple Watch SE models on sale this weekend for $50 off MSRP on their online store. Sale prices available for online orders only, in-store prices may vary. Order online, and choose... Read more
Mac Pro with M2 Ultra CPU on sale for $6699,...
In the market for one of Apple’s Mac Pro towers? B&H Photo has the base Mac Pro with an Apple M2 Ultra CPU, 64GB RAM, and 1TB SSD on sale for $6699 including free 1-2 day shipping to most... Read more
New May Verizon promotion: Switch and get a f...
Red Hot Deal Days at Verizon: Switch to Verizon this month, and get the 256GB iPhone 15 Pro for free, with trade-in, when you add a new line of service. Verizon is also offering a free cellular iPad... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
13-inch M2 MacBook Airs on sale for only $849...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for $150 off Apple’s new MSRP, only $849. Free 1-2 day delivery is available to most US addresses. Their... Read more
13-inch M3 MacBook Airs on sale starting at $...
Amazon has every configuration and color of Apple’s 13″ M3 MacBook Air on sale for $150 off MSRP, now starting at $949 shipped. Their prices are the lowest available for these Airs among Apple’s... Read more
14-inch M3 Pro/Max MacBook Pro available toda...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
Apple has the Apple Watch Ultra available for...
Apple has several Certified Refurbished Apple Watch Ultra models available in their online store for $589, or $210 off original MSRP. Each Watch includes Apple’s standard one-year warranty, a new... Read more
M2 Mac minis on sale starting at only $449
B&H Photo has M2-powered Mac minis in stock and on sale today for $100 off Apple’s MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $100 – Mac... Read more

Jobs Board

Sublease Associate Optometrist- *Apple* Val...
Sublease Associate Optometrist- Apple Valley, CA- Target Optical Date: Apr 20, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92307 **Requisition Read more
Remote Secret *Apple* MacOS Workspace ONE A...
Job Description The Apple MacOS Workspace ONE AirWatch Engineer role is primarily responsible for managing a fleet of 400-500 MacBook computers. The ideal candidate Read more
Senior Software Engineer - *Apple* Fundamen...
…center of Microsoft's efforts to empower our users to do more. The Apple Fundamentals team focused on defining and improving the end-to-end developer experience in Read more
*Apple* Software Engineer - HP Inc. (United...
…Mobile, Windows and Mac applications. We are seeking a high energy Senior Apple mobile engineer who can lead and drive application development while also enabling Read more
Pharmacy Technician (Community) - *Apple* H...
Pharmacy Technician (Community) - Apple Hill Pharmacy - Day Location: WellSpan Health, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.