Path: slacvm!unixhub!dxcern!sting
From: sting@dxcern
Newsgroups: cern.sting
Subject: C++ class libraries survey
Keywords: C C++ class libraries object oriented OOP
Message-ID: <1992Mar17.102059.3360@dxcern.cern.ch>
Date: 17 Mar 92 10:20:59 GMT
Expires: Wed, 16 Mar 1994 23:00:00 GMT
Sender: sting@dxcern.cern.ch (Mike Sendall)
Distribution: cern
Organization: CERN European Lab for Particle Physics
Lines: 1139
Approved: sting
 
In article <5526@stl.co.uk>, dsr@bnr.co.uk writes:
Organization  BNR Europe Limited, London Road, Harlow, Essex, GB
 
In article <5307@stl.co.uk> I wrote:
>I'd like to know what libraries for C++ are available both
>commercially and public domain.  If possible, an opinion of
>the library would be nice.
>
 
This is a summary of the responses to my query.  Each library name
has a tag field called "Name:" for easy extraction.  This response is
sectioned into Public Domain and Commercial/Private domain.  Any
library whose domain was unknown has been placed in the Commercial/Private
domain.
 
The following people replied to my query and their comments are
integrated in some way into the rest of this summary:-
 
From: trunz <trunz@inf.ethz.ch>
From: Brian M Kennedy <bmk@ninja.csc.ti.com>
From: mi@starlab.uucp (Michael Hoennig)
From: Brian M Kennedy <bmk@ninja.csc.ti.com>
From: Jim_Holt@aprdlgtr.sps.mot.com (Jim Holt)
From: Ethan Bradford <ethanb@ptolemy.astro.washington.edu>
From: Eric Price <ericp@bach.ftcollinsco.NCR.com>
From: P.G.Hamer@bnr.co.uk
From: "James.Falek.3B93" <James.Falek.3B93@bnr.ca>
From: danw@jacobs.cs.orst.edu (Dan Whitaker)
From: pat@bnrmtl.bnr.ca (Patrick Smith)
From: dror@wet.UUCP (dror matalon)
 
The following class libraries are mentioned in this summary:-
 
Name: OATH (Object-oriented Abstract Type Hierarchy)
Name: COOL (C++ Object-Oriented Library)
Name: NIHCL (National Institute of Health's C++ Library)
Name: libg++ (GNU's C++ library)
Name: InterViews
Name: Unidraw
Name: ET++
Name: Classix
Name: NIHCL
Name: Linpack.h++
Name: Matrix.h++
Name: LEDA (Part 1)
Name: LEDA (Part 2)
Name: USL (UNIX System Laboratories Europe Ltd.)
Name: Rational
Name: Booch Components
Name: Open Dialogue
Name: Zinc Interface Library (Iconic user interface)
Name: C++/Views (Iconic user interface)
Name: MacApp (application development toolkit)
Name: ICpak101
Name: ICpak201
Name: NeXTStep (application development toolkit)
Name: CommonView (Iconic user interface)
Name: Analyst (Information Centre)
Name: Humble  (Expert system package)
 
When choosing a library, perhaps the following should be used as a
guideline to the library's "goodness":-
 
        1) Deamnd at least one test case per method
        2) Documentation should be sufficient to allow use in binary
        form.
        3) All "improvements" should be sent to supplier for
        integration into standard product (gets rid of maintenance :-)
        4) Cloning is not reusing.
 
 
Public Domain Libraries
~~~~~~~~~~~~~~~~~~~~~~~
 
Name: OATH (Object-oriented Abstract Type Hierarchy) was designed
as an experiment in increasing object-oriented reuse.
It has a fairly high learning curve, but potentially
higher gains if you are looking for a more flexible and
robust abstraction.  It is completely unsupported.
 
        anonymous ftp from csc.ti.com (192.94.94.1)
        in the file pub/oath.tar.Z
---------------------------------------------------------
 
Name: COOL (C++ Object-Oriented Library) was designed as an
experiment in templates and exception handling.  Templates
are implemented via a preprocessor with an advanced macro
capability.  It displays a different set of trade-offs
from OATH.  It is also completely unsupported.
 
        anonymous ftp from csc.ti.com (192.94.94.1)
        in the file pub/COOL.tar.Z
---------------------------------------------------------
 
Name: NIHCL (National Institute of Health's C++ Library) is
essentially a mapping of part of Smalltalk's library
into C++.  It lies somewhere between OATH and COOL.
It is a little better supported and there is a textbook
by the author, Keith Gorlen, that is fairly good documentation.
However, the Smalltalk hierarchy is not completely
consistent (IMO) with the C++ strong typing nature.
It is weakly supported.
 
        anonymous ftp from alw.nih.gov (198.231.128.251)
        in the file pub/nihcl.tar.Z
---------------------------------------------------------
 
Name: libg++ (GNU's C++ library) is probably only relevant if
you are using g++; and if so, you already know about it.
It does have some good implementations of bignum's and
of regular expressions and strings.
 
        anonymous ftp from aeneas.mit.edu (18.71.0.38)
        in pub/gnu/libg++-*
---------------------------------------------------------
 
Name: InterViews is an excellent GUI class library (IMO, the best)
developed by Stanford University.  Make sure you get v3.0 or
later (it is significantly improved from 2.6).  V3.1 should
be out in March, basically rounding out and solidifying the
3.0 approach.  This library contains excellent examples of
multiple inheritance used profitably.
 
        anonymous ftp from interviews.stanford.edu
---------------------------------------------------------
 
Name: Unidraw is a graphical editor building library based on top
of Unidraw.  I would suggest waiting to V3.1's release.
 
        anonymous ftp from interviews.stanford.edu
---------------------------------------------------------
 
Name: ET++ is a large GUI library and other C++ tools developed
in Europe
 
        anonymous ftp from apple.com
        in pub/ArchiveVol2/et++/*
 
        or nuri.inria.fr
        in gnu/et++-2.0.tar.Z
---------------------------------------------------------
 
 
Name: Classix
 
In addition to Rogue Wave, Empathy offers a good general-purpose
library called Classix.
 
----------------------------
 
Name: NIHCL
 
If you really want Public Domain, there is NIHCL, which is public domain
in the US, and apparently outside as well. Here's some information; if
no one mails you ftp directions for it, let me know and I'll see what I
can find.
 
>From the file "COPYRIGHT"
 
    The following applies to the NIH Class Library, unless noted otherwise
    in the source file:
 
            THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
            "UNITED STATES GOVERNMENT WORK".  IT WAS WRITTEN AS A PART OF THE
            AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE.  THIS MEANS IT
            CANNOT BE COPYRIGHTED.  THIS SOFTWARE IS FREELY AVAILABLE TO THE
            PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
            RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
 
    An exception to this are the files lib/regex.h and lib/regex/regex.c.,
    which are Copyright (C) 1985 Free Software Foundation, Inc.  See these
    files for the terms and conditions governing this software.
 
 
 
>From the file "README"
 
       Release Notes  NIH Class Library Revision 3.0  Release Notes
 
 
 
 
            INTRODUCTION
 
            These are the release notes for Revision 3.0 of the NIH  Class
            Library, the version of the library described by our book Data
            Abstraction and Object-Oriented Programming in C++ by Keith E.
            Gorlen,  Sanford  M.  Orlow,  and  Perry S. Plexico (ISBN 0471
            92346 X), published by John Wiley and Sons.
 
            This release of the NIH Class Library contains  the  following
            classes:
 
            NIHCL---Library Static Member Variables and Functions
                Object---Root of the NIH Class Library Inheritance Tree
                    Bitset---Set of Small  Integers  (like  Pascal's  type
            SET)
                    Class---Class Descriptor
                    Collection---Abstract Class for Collections
                        Arraychar---Byte Array
                        ArrayOb---Array of Object Pointers
                        Bag---Unordered Collection of Objects
                        SeqCltn---Abstract  Class  for  Ordered,   Indexed
            Collections
                            Heap---Min-Max Heap of Object Pointers
                            LinkedList---Singly-Linked List
                            OrderedCltn---Ordered  Collection  of   Object
            Pointers
                                SortedCltn---Sorted Collection
                                    KeySortCltn---Keyed Sorted Collection
                            Stack---Stack of Object Pointers
                        Set---Unordered   Collection   of    Non-Duplicate
            Objects
                            Dictionary---Set of Associations
                                IdentDict---Dictionary  Keyed  by   Object
            Address
                            IdentSet---Set Keyed by Object Address
                    Date---Gregorian Calendar Date
                    FDSet---Set of File Descriptors for Use with select(2)
            System Call
                    Float---Floating Point Number
                    Fraction---Rational Arithmetic
                    Integer---Integer Number Object
                    Iterator---Collection Iterator
                    Link---Abstract Class for LinkedList Links
                        LinkOb---Link Containing Object Pointer
                        Process---Co-routine Process Object
                            HeapProc---Process with Stack in Free Store
                            StackProc---Process with Stack on main() Stack
                    LookupKey---Abstract Class for Dictionary Associations
                        Assoc---Association of Object Pointers
 
 
 
            May 25, 1990                                          Page 1
 
 
 
 
 
            Release Notes  NIH Class Library Revision 3.0  Release Notes
 
 
                        AssocInt---Association  of  Object  Pointer   with
            Integer
                    Nil---The Nil Object
                    Point---X-Y Coordinate Pair
                    Random---Random Number Generator
                    Range---Range of Integers
                    Rectangle---Rectangle Object
                    Scheduler---Co-routine Process Scheduler
                    Semaphore---Process Synchronization
                    SharedQueue---Shared Queue of Objects
                    String---Character String
                        Regex---Regular Expression
                    Time---Time of Day
                    Vector---Abstract Class for Vectors
                        BitVec---Bit Vector
                        ByteVec---Byte Vector
                        ShortVec---Short Integer Vector
                        IntVec---Integer Vector
                        LongVec---Long Integer Vector
                        FloatVec---Floating Point Vector
                        DoubleVec---Double-Precision Floating Point Vector
                OIOifd---File Descriptor Object I/O readFrom() Formatting
                OIOin---Abstract   Class   for   Object   I/O   readFrom()
            Formatting
                    OIOistream---Abstract  Class  for  Stream  Object  I/O
            readFrom() Formatting
                        OIOnihin---Stream Object I/O readFrom() Formatting
                OIOofd---File Descriptor Object I/O storeOn() Formatting
                OIOout---Abstract   Class   for   Object   I/O   storeOn()
            Formatting
                    OIOostream---Abstract  Class  for  Stream  Object  I/O
            storeOn() Formatting
                        OIOnihout---Stream Object I/O storeOn() Formatting
                ReadFromTbl---Tables used by Object I/O readFrom()
                StoreOnTbl---Tables used by Object I/O storeOn()
------------------------------------
 
Commercial/Private Libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Name: Linpack.h++
Name: Matrix.h++
 
  N E W    P R O D U C T    R E L E A S E
 
   C++ Version of Linpack Announced
 
Rogue Wave Software, Inc., November 1, 1991.  Rogue Wave Software,
Inc. announces today that it has started shipping two new C++ class
libraries, Matrix.h++ and Linpack.h++.  These new C++ class libraries
extend the C++ language to include numerical algorithms that were
previously available only in Fortran.
 
Linpack.h++ is an object-oriented C++ version of the widely used Fortran
library.  Linpack.h++ includes 100% of the functionality of the Fortran
version, plus much more.  Because Linpack.h++ is written in C++ it has
capabilities that far exceed the Fortran version.
 
C++'s unique position as an extensible object-oriented language that is
extremely efficient makes it one of the best languages for solving
complex  numerical problems.  Rogue Wave's new libraries take full
advantage of C++'s strengths:  operator overloading, object-orientation,
and speed.  Programmer productivity is boosted because you work with
whole objects that represent numerical data rather than low-level "DO"
loops.  The result is fewer, but more expressive, lines of code.  But,
because these libraries are based on highly-optimized low-level assembly
routines, they are extremely fast, frequently faster than the equivalent
Fortran.
 
Dr. Thomas Keffer, President of Rogue Wave Software, Inc. says
"Matrix.h++ and Linpack.h++ both represent major milestones for the
C++ and numerical communities.  Engineers, scientists, and financial
analysts now have the C++ tools needed to make their job easy.  The lack
of these tools has kept them chained to Fortran."
 
Charlie Finan of CRAY Research had this to say of Linpack.h++:
"Looks like you wrote the classes just the way I would...and my job is to
write fast code!  You did it right!"
 
Both Matrix.h++ and Linpack.h++ are completely compatible with Rogue
Wave's other C++ class libraries, Tools.h++ and Math.h++, which are
accepted standards in the industry.  Matrix.h++ and Linpack.h++ are
available for most machines, from MS-DOS to UNIX, including a
vectorized version for the CRAY.
 
Matrix.h++ includes all the funtionality of Math.h++.  For example:
general matrices, vectors, statistics, complex numbers, Fast Forier
Transformation (FFT's), etc.  Matrix.h++ adds specialized matrix classes
such as banded, symmetric, positive-definite, Hermitian, tridiagonal, etc.
Because Matrix.h++ includes Math.h++, it can take advantage of
Math.h++'s highly optimized low-level assembly routines, making it fast
as well as graceful.
 
Linpack.h++ is the jewel of C++ math classes.  Linpack.h++ includes all
of Matrix.h++, plus all of the functionality in the original and well-
established Fortran version; including solutions of systems of equations
for a variety of matrix types, solutions of over- and under-determined
systems of equations, incremental least squares solvers, etc.  But,
Linpack.h++ is a tru object-oriented library, not just a C version that
compiles under C++:  the traditional messiness of the Fortran version has
been replaced with high-level, yet efficient, objects that make code far
easier to write and maintain.
 
The classes are available now.  Prices range from $199 to $995 for
Matrix.h++ and $299 to $1195 for Linpack.h++.
 
Rogue Wave Software Inc. is a software company that develops and sells
high quality C++ class libraries.  Its customers include end users and C++
compiler manufacturers such as Borland, JPI, Oregon Software, Liant
Software, and others.  Rogue Wave Software Inc. is located at 1325 NW
9th Street, Corvallis, OR, 97330, (503) 754-2311.
 
---------------------------------------
 
Name: LEDA (Part 1)
 
There is LEDA, Library of Efficient Datatypes and Algorithms, by Stefan
N"aher from Germany. It is available for educatioal purposes but its NOT in
the public domain.
 
Provides basic data-types like lists, stacks, queues, trees, sets,
partitions, priority queues and a few others. These are parameterizable
classes, you may add your own datatype and have a priority queue ...
An important datatype is a graph, these are also parameterizable and there
are useful algorithms for them like shortest path, transitive closure,
matching, maximum flow, spanning tree and others, we have implemented a few
algorithms for dealing with perfect graphs, but these ar not part of the
standard library.
The latest part deals with computational geometry, as we are a graph theory
group I have not looked at that part yet.
 
Opinion : very useful, has saved me a lot of work when messing around with
basic datastructures and simplifies notation quite a bit. It provides
exactly those things which you would need, but do not have the time to mess
around with when you need to solve a problem. It takes fairly little time
to know how to use it, but due to the implementation of generics as
preprocessor macros its not as flexible as a full blown class library with
templates for instance. (besides : which compiler has templates ?)
 
----------------------------------------------------
 
Name: LEDA (Part 2)
                                  LEDA
 
             A Library of Efficient Data Types and Algorithms
 
                             Stefan Naeher
                   Max-Planck-Institut fuer Informatik
                  Im Stadtwald, 6600 Saarbruecken, FRG
 
                        (stefan@mpi-sb.mpg.de)
 
 
LEDA is a library of the data types and algorithms of combinatorial computing.
The main features are:
 
1.  LEDA provides a sizable collection of data types and algorithms in a form
    which allows them to be used by non-experts. In the current version, this
    collection includes most of the data types and algorithms described in the
    text books of the area.
 
2.  LEDA gives a precise and readable specification for each of the data types
    and algorithms mentioned above.  The specifications are short (typically,
    not more than a page), general (so as to allow several implementations),
    and abstract (so as to hide all details of the implementation).
 
3.  For many efficient data structures access by position is important. In
    LEDA, we use an item concept to cast positions into an abstract form. We
    mention that most of the specifications given in the LEDA manual use this
    concept, i.e., the concept is adequate for the description of many data
    types.
 
4.  LEDA contains efficient implementations for each of the data types, e.g.,
    Fibonacci heaps for priority queues, red-black trees and dynamic perfect
    hashing for dictionaries, ...
 
 
5.  LEDA contains a comfortable data type graph. It offers the standard
    iterations such as ``for all nodes v of a graph G do'' or ``for all
    neighbors w of v do'', it allows to add and delete vertices and edges
    and it offers arrays and matrices indexed by nodes and edges,...
    The data type graph allows to write programs for graph problems in a
    form close to the typical text book presentation.
 
 
6.  LEDA is implemented by a C++ class library. It can be used with the C++
    compilers cfront 2.0, cfront 2.1, g++-1.37.1 or g++-1.40.3. It is
    distributed via anonymous ftp from sbsvax.cs.uni-sb.de (134.96.252.31),
    file: /pub/LEDA/LEDA-<version>.tar.Z
 
 
 
---------------------------------------------------
 
Name: USL (UNIX System Laboratories Europe Ltd.)
 
 
   UNIX System Laboratories Europe Ltd.
   International House
   Ealing Broadway
   London W5 5DB England
   +11-44-81-587-7711
 
It appears quite complete (unless you have some specific, uncommon
needs); Booch may have an edge in supporting concurrency. USL may have
more installations and greater maturity.
 
------------------------------------------------------
 
Name: Rational
Name: Booch Components
 
Rational markets the C++ Booch objects which are a somewhat bizarre,
but possibly quite innovative, set of library objects.
 
The US phone number for Rational is: Rational OO products 408-496-3700
 
It appears quite complete (unless you have some specific, uncommon
needs); Booch may have an edge in supporting concurrency. USL may have
more installations and greater maturity.
 
------------------------------
 
Name : StarView (long)
 
A Portable C++ Class Library for Graphical User Interfaces
 
Author:     Andreas Meyer, STAR DIVISION
 
Contact:    STAR DIVISION GmbH
            Andreas Junge
            Zum Elfenbruch 5-11
            D-2120 Lueneburg
 
            Phone: ++49 4131 700943
            Fax:   ++49 4131 700921
            Email: ...!unido!starlab!aj
 
The development of large applications for Graphical User Interfaces
(GUI's) like MS-WINDOWS, MS Presentation Manager or OSF/Motif is a very
time consuming job. In addition, the application programming interfaces
(API's) of the different GUI's are totally incompatible making a direct
port of source code to another GUI platform impossible, almost all code
driving the user's interface must be re-written by the programmer.
 
Two years ago, STAR DIVISION decided to develop a set of new applications
for GUI's which should fulfill the requirements of modern software
standards this entails:
 
-   portability between the operating systems MS-DOS, OS/2, Macintosh
    and different UNIX flavours
-   at  least portable between  the  GUI's MS-WINDOWS, MS-Presentation
    Manager, MacApp and OSF/Motif
-   fulfillment of the requirements of the different GUI Style
    Guide's
-   data  exchange and direct communication between the applications in
    homogeneous and heterogeneous networks (groupware approach)
 
Because of the indifferent "political" situation (i.e. MS-DOS or OS/2 or
UNIX or everything, WINDOWS or PM or X.11 or everything) we decided to
develop a set of tools which helps us to be mostly independent from the
decisions of the OS and hardware vendors. In addition tools help to
improve productivity and are the base for a successful software project.
C++ is the programming language of our choice because we could use our
large experiences in C programming and C++ provides all major advantages
of Object Oriented Programming (OOP) that is - from our point of view -
the best available paradigm for complex software development today.
 
In this report we want to introduce StarView, a portable C++ Class
Library for Graphical User Interfaces. StarView is one of the major parts
of our total Object Oriented programming environment (we call it SOLAR
system) and to give you an impression of the other tools of the SOLAR
system we will give you a short overview about the Object Management
System ObjectServer at the end of the report. But first we will take a
brief look on Star View
 
1. Introduction StarView
++++++++++++++++++++++++
 
In the conception of StarView three important requirements were to be
fulfilled: StarView applications should display "User Friendlyness",
StarView should be portable between MS-Windows, OS/2 Presentation
Manager, OSF Motif, Apple Macintosh and other GUIs in the future.
Furthermore, it should be easily extendable, allowing the realisation of
diverse applications without the need to extend StarView itself.
 
The requirements of a highly "Userfriendly" StarView application in our
opinion was only to be achieved by user controlled applications.
Previously, an application layed out the way in which a user could
interact with it, allowing the user a restricted path which he/she must
follow. However, today the user controls an application in which he/she
chooses from a multitude of choices and options. The output of the
application is controlled by the user, who upon seeing the choices before
him, can interact with the application by supplying input. This type of
application control can be found in Graphical User Interfaces such as
MS-Windows and in Apple Macintosh.
 
To allow portability between different Graphical User Interfaces,
StarView provides a layer between the application and the different
windowing systems. The differences between systems is hidden from the
application. The result is the following diagram:
 
                       +---------------+
                       |  Applikation  |
                       +---------------+
                               |
                       +---------------+
                       |   StarView    |
                       +---------------+
                               |
        +----------------------------------------------+
        |             |                |               |
  +-----------+ +-----------+   +--------------+ +-------------+
  |    OSF    | |  Windows  |   | Presentation | |    Apple    |
  |   Motif   | |    3.0    |   |   Manager    | |  Macintosh  |
  +-----------+ +-----------+   +--------------+ +-------------+
 
  Relationship between an Application and the Windowing Systems
 
 
In order to allow the desire for easy extendability, an Object Orientated
concept for StarView was choosen. In an Object Oriented System, real
world objects are modeled by classes. From given classes, it is possible
to derive new classes, whereby the functionality of the base class,
either remains or is modified in the derived class. New functionality can
be also included in the derived class. As a result, it is possible to
extend a given class library, without the need to change its contents.
 
With the use of StarView, applications can be quicker and more easily
developed than by using the APIs mentioned above. Additionally, the
applications source code is portable.
 
2. Class Tree - Discription
+++++++++++++++++++++++++++
 
2.1 Overview
 
StarView is composed of a large number of classes, who can be divided
into several functional groups. These groups will be briefly described. A
class tree of StarView and Tools is include in the appendix.
 
To start off, the class Application will be introduced. It is the class
from which all StarView applications are derived and from which the
desired functionality is extended.
 
The next class to be introduced is the class OutputDevice, the class
which contains all output tools. In this class the entire output
functionality is to be found. The functionality of this class is not
bound to any one output device. Here the relationship between the derived
classes Printer, VirtualDevice and Window will be explained.
 
A further group is composed of the classes Window, SystemWindow and
WorkWindow. These classes as well as having OutputDevice methods, also
have Input methods, allowing the user to interact with the windowing
system.
 
A major group is the control group. These are input/output elements which
are used generally in dialog boxes.
 
Dialog boxes are divided into Modal and Modeless. There are a number of
predefined dialogs, which reflect the underlying windowing system.
 
Another group of classes are the Accelerators and the Menus.
 
All of the classes mentioned are derived from the class Resource. Because
of this, instances of each class can be loaded form the Resource.
In a seperate class tree the Tools are shown. Included in this tree are
classes for data types eg; String, Rectangle, Fraction, Pair etc. and
classes for the storage of objects eg; List, Queue, Table, Array etc.
 
2.2 Application
 
The class Application is the central and base class for all applications.
Every appliction is derived from this class. By overloading its virtual
methods, application dependent methods can be implemented eg; Error
handling, Saving data etc.
 
In a StarView application, only one instance of the class Appliction
exists. Should a derived application be created, an Instance of the
derived class is created at module level. This instance is created
automatically at the start of the program. StarView, calls the virtual
method Application::Main(), which must be declared in the derived class.
In the method Main() the initialisation of the application is carried
out, ie. an application window and a menu is created and displayed.
Furthermore, the Applications Execute() method is called. This method
contains the event loop of the underlying windowing system. This method
can only be exited, when the application is terminated. This means, all
objects that were created in the method Main(), exist for the entire
lifetime of the application.
 
    class MyApp : public Application
    {
       public:
            void    Main( int nArgc, char * pArgv[] );
    };
 
    void MyApp::Main( int argc, char* argv[] )
    {
        ...
         Execute();
    }
 
    MyApp aApp;
 
    An example for a derivied Application-class
 
An application can use many windows, however, only one window may be
declared as an ApplicationWindow. When the ApplicationWindow is destroyed
the application is terminated.
 
The class MDIApplication is a derived class which allows the management
of multiple document windows. This class offers methods with which
multiple document windows ( MDI windows ) can be arranged, activated,
closed, etc. Additionally, a menu can be declared as a MDI menu, whereby,
the titles of the MDI windows, are automatically inserted. On selection
of a MDI window in this menu, the corresponding GDI window is
automatically activated.
 
2.3 OutputDevice and Output Tools
 
The OutputDevice class contains the device independent output methods.
The class OutputDevice is the base class of all classes, which are
capable of output ( eg; Window, Printer, VirtualDevice (Bitmap), etc ).
Because of this, it makes no difference if the output is destined for a
Window, Printer or a VirtualDevice. The output routines need only be
implemented once. However, when outputting to a printer, the page
management must be controlled.
 
                +--------------+
                | OutputDevice |
                +--------------+
                       |
          +------------E---------------+
          |            |               |
     +--------+   +---------+  +---------------+
     | Window |   | Printer |  | VirtualDevice |
     +--------+   +---------+  +---------------+
          |            |
         ...          ...
 
    Part of class-ree OutputDevice with derived classes.
 
All OutputDevice methods, work with the output tools Pen, Brush and Font.
These output tools must be selected in the OutputDevice.
 
The Pen class represents a pen used for outputing points, lines, etc.
Pens can have various colours and different thicknesses.
 
The Brush class represents a pattern output method. There is a selection
of predefined patterns, it is also possible to use user defined patterns,
which are passed in the form of a bitmap.
 
The class Font is used to output text. It supports font attributes such
as; font family, size, slant, weight, kerning and many more.
 
Additionally, bitmaps, icons, and the contents of other OutputDevices
(eg: VirtualDevice ) can be outputted to an OutputDevice.
 
The OutputDevice class works with a logical coordinate system. All output
methods use logical coordinates. The logical coordinate system, results
from the selection of a suitable MapMode. With a MapMode, a scaling
factor can be selected and a translation of the coordinate system
specified. By scaling, all output tools are automatically scaled, making
a function like " ZoomIn" very easy to implement.
 
With the use of a GDIMetefile, it is possible to send all output to an
OutputDevice and then replay the output. Because of this, it is very easy
to to carry out a "Repaint". A GDIMetafile can be "played" on all
OutputDevices.
 
2.4 Window
 
Windows have the task of presenting application data in their
presentation area. Additionally, they also have the job of receiving
input from the user. The class Window offers input handling functions in
the form of virtual methods. Handlers, which are virtual methods in the
class Window, are under certain circumstances automatically called. The
application, if required, can derive its own window class from the
WorkWindow class and in doing so, can overload the desired handlers.
There are handlers for Mouse and Keyboard input, for Focus handling, and
for painting the contents of a window. When an event occurs, StarView
calls the corresonding handler of the particular instance. If a handler
is overloaded, this overloaded handler is called, otherwise the default
action in the base class handler is carried out.
 
    class MyWindow : public WorkWindow
    {
        public:
            ...
            virtual void Paint( const Rectangle& rRect );
    }
 
    void MyWindow::Paint( const Rectangle& rRect )
    {
        DrawText( Point( 10, 10), "Hello world" );
    }
 
    An example for a derived WorkWindow-class and the overload of an
    Event-Handler
 
The Window class also offers member functions, which are used to design
and modify windows. A window can be assigned a mouse pointer (Pointer)
and a text cursor (Cursor). When the mouse moves between different
windows, the correct pointer for each window is automatically displayed.
If a window has the focus, its cursor is automatically shown at its last
position. If the window looses the focus, the cursor is automatically
hidden.
 
Windows can be arranged into a hierarchy. Every child window has a parent
window. A child window is always displayed on its parents display area
and is moved automatically if its parent moves. A child window is
restricted to the display area of its parent. A child window is
automatically hidden when its parent is no longer visible.
 
A window can be disabled. In this case, the window is unable to accept
input and may not contain the focus. This state is automatically
inherited by all child windows of a disabled parent window. In the class
WorkWindow, it is possible to specify which user interactions with the
window are allowed and which are forbidden. These include, whether the
window can be moved, sized or if the window can be closed.
 
2.5 Controls
 
Controls are special child windows, which are assigned to parent windows.
Controls are divided into two groups, active controls and passive controls.
Active controls, as the name would suggest, allows the user to interact
with them. Buttons, Edit fields, Scrollbars, Listboxes and Comboboxes are
examlpes of active controls. Passive controls on the other hand, do not
allow the user to interact with them. They are used only to show static
information. The classes FixedText and GroupBox are examples of passive
controls.
 
                             ...
 
                              |
                         +---------+
                         | Control |
                         +---------+
                              |
    +-------------------------E-----------------------------+
    |            |            |              |              |
+--------+   +------+   +-----------+   +---------+   +-----------+
| Button |   | Edit |   | ScrollBar |   | ListBox |   | FixedText |
+--------+   +------+   +-----------+   +---------+   +-----------+
    |            |            |              |              |
   ...          ...          ...            ...            ...
 
    Part of class-tree Control and derived classes.
 
Controls can be gathered into groups, whereby the first control in each
group signifies that a new group is beginning. The order in which
controls are arranged, is specified by the order in which they are
created. With some windowing systems it is possible to jump from one
group to anoher by use of the keyboard.
 
2.6 Dialog
 
The Dialog class is a special form of the Window class. Dialogs can
contain numerous input and output controls. One generally distinguishes
between modal and modeless dialogs. Modal dialogs must be terminated
before the application may proceed. Modeless dialogs on the other hand,
allow the application to proceed unhindered.
 
Active controls have a different mechanism to Windows, when it comes to
interacting with the changeing status of the application. In each
control, it is possible to set a Link for specific events. A Link is
composed of a reference to an object, and a reference to member method of
that object. When the event occurs ( eg: a button is clicked ), the Link
is called and the method is executed. This mechanism has the advantage,
that it is not necessary to derive every control in order to overload a
handler. However, all handlers can be overloaded if desired.
 
As a rule, the application generally uses derived dialog boxes. A derived
dialog box contains controls as member variables. The derived dialog box
also contains the necessary user input functions as menber functions.
Using Links, these input handling functions are set in the member
controls, so that when an event occurs, the correct member function is
called.
 
    class MyDialog : public ModalDialog
    {
        public:
                         MyDialog();
            PushButton   aCancelBtn;
            void         CancelHdl( Button * pButton );
            ...
    }
 
    MyDialog::MyDialog(): ModalDialog(...), aCancelButton(...)
    {
        // Set Link MyDialog::CancelHdl(), which is called on button click
        aCancelBtn.ChangeClickHdl(LINK( this, MyDialog::CancelHdl ));
        ...
    }
 
    MyDialog::CancelHdl( Button * pButton )
    {
        ...
        // exit modal Dialog
        EndDialog();
    }
 
    An example of a derived ModalDialog-class with a PushButton.
 
Dialog boxes can be, like all other windows, loaded from the resource.
The dialogs controls are simultaneously loaded. In the resource, it is
possible to specify controls, which are automatically created, when the
dialog box is created. This is particularlly usefull when used with the
FixedText and GroupBox classes, which are generally not required as
instance variables.
 
The order in which the controls in a dialog box are arranged, is
specified by the order in which the constructors are arranged.
"Automatic" controls loaded from the resource are always first to be
created. If controls are dynamically inserted into the dialog box, after
creation, then they are placed at the end of the order list.
 
It is possible, to create dialog boxes with a dialog editor.
 
2.7 Menus and Accelerators
 
The class Menu is the base class for the classes MenuBar and PopupMenu.
These are types of containers for menu items. They offer methods for the
management of menu items and similarly for the management of handlers. A
menu reports to the application the following user interactions
 
        - Opening of the menu
        - Highlighting of a menu item
        - Selection of a menu item
        - Closeing of a menu item
 
Hierarchical menus are also supported. The class Menu manages the
relationship between menu items and sub-menus. When a menuitem is
selected, an applications menu handler is called.
 
Individual menu items can be referenced by use of an Id, which is unique
to the menu, to which the item belongs. Menu items may also be selected
by use of keyboard "shortcuts".
 
    #define MID_FILE      1
    #define MID_OPEN      2
    #define MID_SAVE      3
    #define MID_QUIT      4
 
    void MyApp::Main( int argc, char **argv )
    {
        MenuBar aMB;
        PopupMenu aPM;
        ...
 
        // Insert menu in menu bar
        aMB.InsertItem( MID_FILE, String( "~File" ) );
        aMB.ChangePopupMenu( MID_FILE, &aPM );
 
        // Initialise PopupMenu ..
        aPM.InsertItem( MID_OPEN, String( "~Open..." ) );
        aPM.InsertItem( MID_SAVE ,String( "~Save" ) );
        aPM.InsertItem( MID_QUIT, String( "~Close" ) );
 
        // Set Menu handler in PopupMenu
        aPM.PushSelectHdl( LINK( &aWin, MyWin::MenuHandler ) );
 
        // Set Applikation menu and show
        ChangeAppMenu( &aMB );
            ...
    }
 
    long MyWin::MenuHandler( Menu * pMenu )
    {
        switch( pMenu->GetCurItemId() ) {
            case MID_OPEN :
                ...
        }
        return TRUE;  // No more processing for this input
    }
 
    An example for Menus an Menu-Handlers.
 
PopupMenus have the special property which allows them to be displayed
anywhere on the screen (eg: at the current mouse position ). As a result,
it is possible to realise a context sensitive user action.
 
A further possible means of selecting a choice in an application, is by
means of the class Accelerator. In an accelerator, a particular key or
combination of keys, are combined with Ids. This key definition may be
created at run time or can be loaded from the resource. When the
particular key is pressed, the corresponding accelerator handler is
called. Moreover, the key is not passed to the application as input.
 
As with menus, it is also possible to define hierarchical accelerators.
By coupling a further accelerator with a entry, it is possible to define
a sequence of keys, which carry out a particular function. If an
accelerator is coupled with a further accelerator, its handler is not
called, but instead, the handler of the coupled accelerator is activated.
 
It is possible, to create Menus and Accelerators from resource files.
 
2.8 Resources
 
Resources allow particular information eg; Menus, Dialog boxes, Strings
etc. to be managed separatly from the application. Through the seperation
of resources from the application, it is very easy for example to
translate an application from one language to another. Furthermore, its
is possible with the use of tools like Font and Dialog editors to edit
the resources. Through the use of resources, it is possible to modify an
application without the need to recompile it. All that is required is to
relink the resources to the application.
 
All classes derived from the class Resource ( see appendix : StarView
Class Tree ), may be loaded from the resource. Additionally, for each
class, it is possible to load self defined data from the resource. This
is an extension of the base windowing system whos functionality is used
as far as possible.
 
Resource files need only be written once, then compiled on each target
system with the system dependent compiler. This insures that the
resources need only be edited in one place. The compiled resources are
bound together into a library and loaded by the application at run time.
 
2.9 Tools
 
The tools as shown in the appendix, will also be released with StarView.
These tools have been independently developed and can be used without
StarView. They were necessary for the developement of StarView, and
should be usefull in other projects. Because of this, they are presented
in the form of a library.
 
The tools can be divided into two groups. The first group is composed of
data types, Size, Point, Range, Rectangle, String are examples. These
classes are used regularly in the StarView interface.
 
The second group of tools is composed of classes, with which, objects can
be managed. Such classes are the classes List, Stack, Queue, Set, Table,
DynArray. By the use of a macro, it is usual to declare derived classes
which are used to manage specific objects. This construction will be
replaced in the new version of C++ by use of templates.
 
2.10 Dialog-Editor
 
The StarView dialog editor, supports the interactive creation of dialog
boxes with controls. Together, the resource files and the "Templates" for
the class definitions are created. This saves a lot of work, as the
dialog specific program code needs only be inserted into the generated
template. Furthermore, is is also possible to interactivley design menus.
Through the use of a test mode, the menus structure can be tested. The
resource files for menus are created by using the dialog editor.
 
Furthermore, it is also possible to interactivley design menus. Through
the use of a test mode, the menus structure can be testet. The resource
files for menus are created by using the dialog editor.
 
3. Compiler-/Platform-Support
+++++++++++++++++++++++++++++
 
StarView will support the following GUI's / Compilers:
 
Windows 3.x
        Borland C++
        Zortech C++
 
 
Presentation Manager
        Zortech C++
 
OSF Motif
        Sun C++
        Zortech C++
        Glockenspiel C++
 
Macintosh
        MPW C++
 
Appendix
    StarView Class tree (not included in the ASCII document)
    Tools Class tree (not included in the ASCII document)
    Example Application
 
Example Application:
 
In the following example, an application is shown, which is composed of
an application window with the title "SV-Example 1". Contained within
this window is the text "hello world". If the window is closed, a dialog
box is shown, asking the user if the application should be terminated.
 
#include <sv.hxx>           // needed for sv.lib
 
class MyApp : public Application
{
    public:
        void    Main( int nArgc, char * pArgv[] );
};
 
class MyWindow : public WorkWindow
{
    public:
           MyWindow() : ( NULL,
                          WinBits( WB_APP|WB_CLOSEABLE ) ){}
      BOOL QueryClose();
      void Paint( const Rectangle& rRect );
};
 
// New definition of Application::Main() for MyApplication
void MyApp::Main( int argc, char* argv[] )
{
    MyWindow aMainWin;      // Application window
 
    // Initialisation of Application window
    aMainWin.SetText( "SV-Example 1" );
    aMainWin.Show();
 
    Execute();
}
 
// New definition of the QueryClose handler
BOOL MyWindow::QueryClose()
{
    // Ask the user should the Application be terminated
    QueryBox aQuery( this, WinBits( WB_OK_CANCEL | WB_DEF_OK ),
             "Do you want to quit?" );
 
    return( aQuery.Execute() == RET_OK );
}
 
// New definition of the Paint handler
void MyWindow::Paint( const Rectangle& rRect )
{
    DrawText( Point( 10, 10), "hello world." );
}
 
MyApp aApp;     // static Applikation instance
 
    A short example application with StarView.
 
----------------------------
 
Name: Open Dialogue
 
HP/Apollo
 
------------------------------
 
Name: Zinc Interface Library (Iconic user interface)
 
Zinc
 
------------------------------
 
Name: C++/Views (Iconic user interface)
 
CNS : Windows/Mac/Motif/OS2
Nice clean interface, powerful and cheap.
 
------------------------------
 
Name: MacApp (application development toolkit)
 
Apple
 
------------------------------
 
Name: ICpak101
Name: ICpak201
 
Stepstone
 
-------------------------------
 
Name: NeXTStep (application development toolkit)
 
NeXT
 
--------------------------------
 
Name: CommonView (Iconic user interface)
 
Glockenspiel
 
--------------------------------
 
Name: Analyst (Information Centre)
Name: Humble  (Expert system package)
 
Xerox SIS : Smalltalk classes
 
======================================================
 
END OF THIS SUMMARY
   Dave Riches
   PSS:    David.S.Riches@bnr.co.uk
   Smail:  BNR Europe Ltd, London Road,
           Harlow, Essex. CM17 9NA.  England
   Phone:  +44 (0)279-429531 x2496
   Fax:    +44 (0)279-454187
 
 
Original newsgroups: comp.object
