[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

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... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.