Newton Technology Journal: Volume 3, Number 1

download Newton Technology Journal: Volume 3, Number 1

of 24

Transcript of Newton Technology Journal: Volume 3, Number 1

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    1/24

    Inside This Issue

    continued on page 3 continued on page

    Volume III, Number 1 January 1997

    New Products New Technology

    New ProductsIntroducing MessagePad 2000andeMate 300 1

    New TechnologyIntroducing Worksfor Newton 1

    New Product FeaturesMessagePad 2000Screen Size andGrayscale Graphics 10

    Newton TrainingDeveloper Training Update 11

    Advanced TechniquesData Structures: Storing and Retrieving(part 1of 3) 12

    Marketing StrategyNSGscommitment to Health Care 16

    Newton TechnologyNewton TechnologyConference 1996

    Technical Overview 18

    IntroducingWorksfor

    Newtonby Henry Cate, Apple Computer, Inc.A newapplication framework isincluded in the

    newproductsfrom Apple. The framework,

    called Works, isintended to provide a simple yet

    powerful shell for productivityapplications,

    much like desktop productswith similar names.

    Four applicationswill be initiallyavailable in

    the Worksframework: a word processor, a

    drawing tool, a spreadsheet, and a calculator

    with graphing capabilities. Thisarticle will give

    you the necessarybackground to begin

    developing additional applicationsfor the

    Worksframework.

    WORKSGOALS

    Simple EnvironmentAn important requirement for the eMate

    300 product wasa simple environment where

    studentscould perform the kindsof tasksthat

    currentlyrequire a desktop computer. The

    Worksframework addressesthisneed. It uses

    a document metaphor that clearlyseparates

    individual projects.

    When the eMate 300 device isset to thesimplified classroom mode, the title bar and

    filing interface are hidden to prevent work

    from appearing to be lost. Workskeepsthe

    user data separate when in the multi-user

    mode. Worksisalso tightlyintegrated with

    the newclassroom connection server.

    Unlike desktop productivityapplications,

    Workson the Newton platform isextensible

    through the stationerymechanism. Third parties

    IntroducingMessagePad 2000

    and eMate 300by Maurice Sharp and Bob Ebert,Apple Computer, Inc.

    NEWPRODUCTOVERVIEW

    In the fall of thisyear the Newton SystemsGroup,

    part of the Information Appliance Division of

    Apple Computer, Inc., will announce two new

    productsbased on the Newton OS. The new

    products, which will begin shipping in the first

    half of 1997, are the MessagePad 2000and the

    eMate 300. Thisarticle providesan introduction

    to the hardware, OS enhancements, and new

    applicationsthat are part of these products.

    MessagePad 2000

    The MessagePad 2000 isa cost-

    effective, powerful, easy-to-use

    hand-held computer than can

    provide targeted solutionsin

    both the horizontal and

    vertical markets.

    Based on the

    latest StrongARM

    RISC processor,

    the newdevicerunsthe Newton OS up

    to ten timesfaster than previous

    devices. It further addsto the power of Newton

    OS 2.0 byproviding sound in to the existing

    sound out capability, a grayscale display, IrDA

    interface support, auto docking, and improved

    support for text editing. There are also two PC

    Card slots, enabling solutionsthat require both

    a memorycard and a communicationscard.

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    2/24

    January 1997 Newton Technology Journal

    2

    HAPPY NEWTON YEAR!!!

    Whew! 1996hasbeen a landmark year for

    the Newton Platform, and we've taken a giant

    step forward, both asa technologyand asa

    developer community. Hopefullymost of you

    have had the opportunitybynowto test the

    newNewton devices-the Newton

    MessagePad 2000and the Apple eMate 300

    at the Newton TechnologyConference last

    November or at a seed site. Both models

    were quite the hit at Comdex in LasVegas!

    We had a record number of attendees

    for the 1996 Newton Technology

    Conference, and according to preliminary

    reports, the feedback we've received is

    overwhelminglypositive. It seemsthat

    you appreciated the shorter conference

    length (2.5 daysplusa dayof lab time) ,

    and the General Technologysession

    showcasing an arrayof technical talkswas

    a hit. The "New to Newton" track wasa

    sell-out, and the Businesstrack allowed

    small businessownersto hear about both

    marketing and technical information. Of

    course, the highlight of the conference

    waswho else but our own talent

    extravaganza, the DTS Players("Read the

    charges: $249 for a skit or $5 for a song!" )

    If you have more feedback about the

    conference, please let me know at

    , andwe'll be sure to consider it when planning

    for thisyear'sconference.

    During Comdex, both the eMate 300and

    MessagePad 2000took Byte'sBest of Comdex

    Finalist honorsand were demonstrated tothousandsof people. Current MessagePad

    ownerswere blown awaybythe sheer power

    of the MessagePad 2000. In addition to speed,

    other popular featureswere the extra PC slot

    and grayscale display. And nearlyeveryone

    who walked through the Apple or Newton

    boothsand caught a glimpse of the Apple

    eMate 300had to stop and take a closer look

    at the unique and interesting design. Typical

    observationsranged from, "It'scute!" and "It

    lookslike the front of a car!" to "Can I get one

    in [fill in the color]?" and "Mykid would love

    this!" Camerasflashed, people "ooh"ed and

    "ahh"ed, and nearlyeveryone asked where

    theycould get one for themselves, especially

    college students, parents, and mobile

    businesspeople. Show-goersseemed most

    impressed bythe eMate 300'sdurability,

    projected price, and extraordinarybatterylife.

    In thisfirst Newton TechnologyJournal

    issue of 1997, we cover everything you need

    to knowto port your applicationsto the new

    hardware, and we've even boiled it down to a

    convenient list in the "Updating Your

    Application" checklist on page 23. The article

    "NewProduct Overview" offersyou quick

    accessto an understanding of the new

    featuresof both products. You'll find in-depth

    information on several topics, with

    "MessagePad 2000 Screen Size and Gray-

    Scale Graphics" and "Introducing Worksfor

    Newton". Don't misspart 1 of the excellent

    article "Data Structures Storing and

    Retrieving".

    It isan exciting time here in the Newton

    SystemsGroup while we prepare for the

    release of the MessagePad 2000 and the

    Apple eMate 300. AsNewton developers, you

    are the future of these products. Thank you

    for your continued support, encouragement,

    and firm belief in the qualityand future of

    Newton technology. From all of usin the

    Newton SystemsGroup, we wish yououtstanding successand a great year!

    Jen Dunvan

    Published by Apple Computer,Inc.

    Jennifer D unvan Managing Editor

    GerryKane Coordinating Editor,Technical Content

    Gabriel Acosta-Lopez Coordinating Editor, DTS and

    Training Content

    Technical Peer Review Board

    J. Christopher Bell,Bob Ebert, D avid Fedor,

    Ryan Robertson,Jim Schram, M aurice Sharp,

    Bruce Thompson

    Contributors

    Bob Ebert, M aurice Sharp, Jim Schram,D avid Fedor,

    J. Christopher Bell, Bruce Thompson, Henry Cate,

    Vernon Huang

    Produced by Xplain Corporation

    N eil T icktin Publisher

    Jessica Courtney Production Editor

    InfoG raphix Design/Production

    1997 Apple Computer,Inc.,1 Infinite Loop,C upertino,C A95014,408-996-1010. A ll rightsreserved.

    Apple, the Apple logo, APD A, AppleDesign, AppleLink,AppleShare, Apple SuperDrive, AppleTalk, HyperCard,LaserWriter,Light Bulb Logo,Mac,M acApp,Macintosh,MacintoshQ uadra, MPW, N ewton, N ewton Toolkit, N ewtonScript,Performa, Q uickT ime, StyleW riter and WorldScript aretrademarks of Apple C omputer, Inc., registered in the U.S. andother countries. AO CE, AppleScript, AppleSearch, ColorSync,develop, eWorld, Finder, O penD oc, Power M acintosh,Q uickD raw, SNA ps, StarCore, and Sound Manager aretrademarks,and AC O T isa service mark of Apple Computer, Inc.Motorola and Marco are registered trademarksof Motorola, Inc.N uBus is a trademark of Texas Instruments. PowerPC is atrademark of International BusinessM achinesCorporation, usedunder license therefrom. W indowsis a trademark of M icrosoftCorporation and SoftWindowsisa trademark used under licenseby Insignia from Microsoft Corporation. UN IX is a registeredtrademark of UN IX System Laboratories, Inc. D eveloper Centralis a trademark of X plain Corporation. CompuServe, PocketQ uicken by Intuit, CIS Retriever by BlackLabs, PowerForms bySestra, Inc.,AC T ! bySymantec,Berlitz,and all other trademarksarethe propertyof their respective owners.

    Mention of products in this publication is for informationalpurposes only and constitutes neither an endorsement nor arecommendation.A ll product specificationsand descriptionsweresupplied by the respective vendor or supplier. Apple assumesnoresponsibility with regard to the selection, performance, or use ofthe products listed in this publication. A ll understandings,agreements,or warrantiestake place directlybetween the vendorsand prospective users. Limitation of liability: Apple makes nowarrantieswith respect to the contentsof productslisted in thispublication or of the completenessor accuracyof thispublication.Apple specifically disclaims all warranties, express or implied,including, but not limited to, the implied warranties ofmerchantabilityand fitnessfor a particular purpose.

    Volume III, Number 1 January 1997

    Letter From the Editorby Jennifer Dunvan

    Editors Note

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    3/24

    Newton Technology Journal January 1997

    3

    The power and featuresof MessagePad 2000will appeal to newtypesof

    customersin addition to existing fansof Newton products. I t will also allow

    developersto create whole newclassesof solutions. Between the Appleproduct bundlesand these newsolutions, we can take the Newton platform

    to the next stage of growth.

    eMate 300

    The eMate 300 isa rugged, low-cost computer with a large

    grayscale screen and embedded keyboard and isintended for use in

    the education market.

    The education market isa newone for the Newton OS. The US education

    system alone consistsof one hundred thousand schoolswith 48million

    students, 2.8million teachers, and nearlya million administrators. The US

    government in Goals2000hasset a student to computer ratio for the

    classroom of three to one. To achieve this, nearly12million computerswill

    need to be purchased for schoolsin the next four years.

    At lessthan half the price of a lowend desktop or one third the price of a

    laptop, the eMate 300makesthese goalsmore achievable because it offers

    nearlyall the productivityof a traditional computer. Long batterylife, durable

    and lightweight hardware, and connectivityto traditional computersset the

    expectation that the eMate 300will be extremelypopular with students,

    teachers, and administrators.

    COMMONFEATURESThe MessagePad 2000 and the eMate 300 are both built around the

    same basichardware design and OS. Here are the featurescommon to

    both products.

    Based on Newton OS 2.0

    The newoperating system isan extension of the 2.0release of the

    Newton OS. Applicationswritten for existing Newton productswill work on

    both the eMate 300and MessagePad 2000devices. Data can be freely

    exchanged between the newdevicesand existing products.

    Selected enhancementshave been added to the OS to improve support

    for the newhardware. Support for the keyboard, larger grayscale display, and

    additional communicationshardware isfullyintegrated. A basicviewclasstuned specificallyfor word processing hasbeen added, and a newset of

    applicationsand a framework are also provided.

    NewSilicon

    In order to make it easier for Apple and itslicenseesto create devices

    based on Newton technology, CirrusLogic, Inc. and Apple Computer, Corp.

    worked together to produce a core Newton Technologychipset. The result is

    the Apple Newton PDA Chipset. There are four basicchipsin the set: a

    Digital System Controller (DSC), an Analog System Controller (ASC), an IR

    Controller (IRC) and a PC Card Controller. AnyNewton device will add ROM,

    RAM and I/O (ports, screen, speaker, PCMCIA, etc.) .

    The eMate 300and The MessagePad 2000are the first Newton devicesto

    be introduced using thisnewchipset. Although the unitsdiffer radicallyfrom

    each other in physical appearance, thanksto the chipset their schematicsare

    nearlyidentical.

    Grayscale

    Both eMate 300and the MessagePad 2000feature half-VGA sized four-bit

    grayscale displaysthat will showsixteen shadesof gray. The Newton OS has

    been extended to support both grayscale and color while still maintaining full

    backward compatibility. All existing callsnowsupport both monochrome and

    color objects, and APIshave been added to accessthe newgray/color features.

    Color valuesare specified using an RGB triplet where the valuesare either

    five or eight bits, for 16or 24-bit color. Color can be used for patterns,

    drawing and text. The system can displaycolor PICTsand bitmapsthat have

    one, two, four or eight bit depth, and there issupport for antialiasing

    monochrome bitmaps.

    Newton Toolkit and Newton Presswill be updated to seamlesslysupport

    grayscale and color imagesaswell asthe larger screen sizes.

    Keyboard

    Extensive enhancementshave been made to improve support for

    keyboards. Menusand buttonsallowkeyequivalentsand keyboard

    navigation, and standard keycombinationsare handled bythe system.

    Event handlerscan be added for command keys, or for anykey

    combination, and like other NewtonScript structures, the keydefinitions

    can use inheritance chainsto reduce memoryrequirements. Menusand

    command keyscan use the same definition framesto further simplifydesign and coding.

    In the newOS, anyviewmayaccept keyboard input, and viewsare now

    notified when theygain and lose keyboard focus. All viewsalso get a chance

    to preprocessanykeyinput, for fullycustomizable interfaces.

    Sound

    The updated Newton OS featuresenhanced sound output and hasadded

    sound input. Most of the newfunctionalityisprovided to developersbya

    newproto, protoSoundChannel, which makesit possible to: specifya

    direction (input or output); queue up soundsfor playback or recording; and

    continued from page 1

    Introducing MessagePad 2000 and eMate 300

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    4/24

    January 1997 Newton Technology Journal

    4

    pause or stop recording or playing. It isalso possible to specifythe channel

    for the sound: line-in, or the MessagePad 2000sembedded microphone; or

    speaker, line-out, or the eMate 300sheadphone jack. Another newproto is

    (protoSoundFrame) can be used to accesssound data, such asfinding the

    playing time of a sound, and there are newuser interface elementsfor

    recording sounds.

    There issupport for playback of up to four simultaneoussounds. The OS

    will also support recording or playing 8-bit (Macstandard) or 16-bit linearencoded (CD quality) sounds.

    IrDA

    Existing Newton devicesuse the Sharp ASK IR communicationsprotocol.

    The newdevicesuse the Infrared Data Associations(IrDA) standard for

    infrared communication. Thisisa cross-platform standard supported on both

    Windows-based and MacOS computers, aswell asother devicessuch asIR

    printers. The newdevicesalso support ASK for backward compatibility.

    The IrDA implementation in the Newton OS includesthe link access

    protocol specification (IrLAP), the link management multiplexer protocol

    specification ( IrLMP), and the hardware serial infrared interface specification

    (SIR). SIR includescommunicationsratesup to 115kbps, and also supports

    both primaryand secondaryroles(that is, the Newton device can be either a

    client or a server.)

    IrDA isfullyintegrated into the Newton endpoint communication

    paradigm. Existing code can be easilymodified to take advantage of IrDA.

    Unlike the ASK protocol, IrDA simulatesa full duplex connection.

    Text Engine

    A newviewclasshasbeen added to greatlyimprove performance with

    large blocksof text. Text isdisplayed in a paged, WYSIWYG manner that can

    scroll veryquickly. Text blocksup to the limit of available user storage can be

    viewed and edited with no delays.

    The text isfullystyled, including multiple font facesand sizesin various

    styles. Picturesof anysize, in the form of Newton shapes, can also be

    embedded in text.

    Rulersallowformatting on a paragraph-by-paragraph basis. Margins, line

    spacing, indenting, and justificationsare all supported, asare left, right,

    center, and decimal tabs.

    Interfacesprovide developerswith the abilityto read and manipulate any

    text attributes. Itsalso easyto convert between text positionsand screen

    locationsuseful for determining when a word hasbeen tapped. Editing

    commandssuch ascut, copy, paste, and clear are built in, and there are calls

    for search and replace that work whether the text isdisplayed on screen or

    stored in a soup.

    The text engine isvirtuallya complete word processor, and can be used as

    a base classfor other applicationssuch asHTML viewers, hypertext browsers,

    email editors, reference engines, and so on.

    Spell Checker

    Using the built-in dictionaries, the newOS nowfeaturesthe abilityto

    check spellingsand offer alternativesfor misspelled words. APIsallow

    developersto integrate spell checking with their own applications.

    NewtonWorks

    A newextensible application framework hasbeen added to facilitate

    classroom use. Designed for the eMate 300but also available on the

    MessagePad 2000platform, the framework, dubbed NewtonWorks or simply

    Works, isa shell for basicproductivityapplicationssuch asword processing,

    drawing, math and graphing, and spreadsheets.

    Worksusesa document metaphor. Each paper, drawing, graph,

    spreadsheet, or whatever appearsasa single self-contained document. Works

    providesthe framework for viewing and editing each document, and for

    switching between documents.

    Developerscan add newtypesof documentsto the Worksshell by

    registering stationery, much like extending the Notesapplication on existingNewton devices. Works-specificfeatureshave been added on top of the

    stationeryAPIsto allowfor application specifichelp and preferences, custom

    data in title slips, Works-wide searches, and custom tools. Onlya single

    viewer/editor needsto be provided, and multiple print or routing formats

    mayalso be added.

    Like the Notesapplication, Worksapplicationsmust be designed to store

    document data in a single soup entry. The Worksframework managesthe

    data storage so that applicationsdevelopersdont need to worryabout soup

    design. The Worksframework also providesboth horizontal and vertical

    scrolling, title bars, and a statusbar that can be extended with custom

    buttonsand menus.

    The Worksframework also allowsapplicationsto customize each other, by

    providing a registryfor tools. The built in Worksapplicationsall support

    variousformsof third partyextensionsusing thistoolsregistry, and some

    allowadditional extensions.

    Word Processor

    A standard word processor application isprovided within the Works

    framework. In addition to providing a ruler, button and menu user

    interface to the Text Engine, the word processor featuresa spell checker

    and quick sketch editor.

    A spell checker and quick sketch tool are integrated with the word

    processor asstandard Workstools, and other toolscan be added using

    the same facility.

    Drawing

    Also provided within the Worksframework isa draw-style graphics

    application. The application providesthe usual range of shape creation

    toolsin a tool bar: lines, squaresand rectangles, circlesand ovals, curves,

    and polygons, along with a shape recognizer tool. Each shape maybe

    drawn with a varietyof line stylesor fill patterns, using the grayscale

    capabilitiesof the devices.

    Adding to these standard tools, the drawing stationeryalso provides

    a set of picturesthat can be stamped onto a drawing. The set of

    stamps, and the available fill patternscan easilybe extended through

    draw application interfaces.

    The Drawing editor supportsthe standard Worksfeature of an

    extensible Toolsmenu, and APIsare also provided to allowdeveloperstoextend the tool bar with custom drawing tools, and provide custom editing

    of the shapescreated.

    Because the contentsof a drawing are based on standard

    NewtonScript shapes, drawingscan be easilyintegrated with other

    applications. Cutting and pasting between a drawing and a word

    processor document isa simple operation.

    Calculations

    Another Worksdrop-in isstationerythat providesgraphing calculator

    features. Userscan enter and evaluate variablesand equationsusing standard

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    5/24

    mathematical notation, and displaythe resulting functionsin a graph or a

    table view. Polar and parametricgraphsare supported, and the interface

    makesit easyto zoom in to look at detailsor zoom out to get a big picture.

    Teachersor other expertscan easilycreate and distribute pagesof

    pre-defined equationsor constants, or templatesfor homework.

    Developerscan further extend the set of built-in functionsand constants

    to provide custom functionsfor specialized financial, statistics,

    engineering or science applications.The math environment, equation editor, and graph and table displaysare

    provided asprototypesthat can be used in other applications.

    Newton Interconnect

    A major limiting factor in obtaining a thinner profi le for MessagePad

    deviceshasbeen the DIN9 port used for serial and AppleTalk

    communications. In order to facilitate thinner devices, Apple has

    adopted a new standard connector for the Newton platform. The result

    isNewton Interconnect.

    The connector isa JAE 26-pin connector which requiresa JAE 26-pin

    custom plug. The height of the connector ismuch lessthan a DIN9. In

    addition to the serial/LocalTalk port, the pinsallow accessto power

    in/out, audio line-in and line-out and another serial input that hasno

    LTC Line Driver. There isalso an auto docking pin that tellsthe unit it

    hasbeen connected.

    MessagePad 2000 will come bundled with a DIN9-to-Interconnect

    adapter, and eMate 300 includesboth ports, so current cabling doesnot

    need to be replaced.

    Value Series Flash

    Advancesin technologyhave enabled much cheaper FLASH memory.

    Thisnewtechnology, called Value Series FLASH allowsRAM PC cardsto be

    productsfor about half the cost of current cards. The Newton OS supports

    thistype of memory. The eMate 300hardware fullysupportsonlythe new

    type of card, though it will allowread onlyaccessto older (12V) memory

    cards. The MessagePad 2000will read and write both (5V) Value Seriesand

    (12V) existing PC cards.

    Serial Number Chip

    Both eMate 300 and MessagePad 2000 come with an on board

    serial number chip. Each device will have a unique serial number that

    can be accessed through a secure NewtonScript API . Thisprovides

    developerswith the abilityto easilyregister or copyprotect their

    software, or track individual units.

    MESSAGEPAD2000MessagePad 2000 isa major step forward in the evolution of the

    MessagePad product line. It isa cost-effective, powerful, easy-to-use hand-held computer than can provide targeted solutionsin both the horizontal

    and vertical markets.

    MessagePad 2000Provides:

    The fastest hand-held computer experience!

    More memoryfor applicationsand capturing data.

    Long batterylife.

    Accessto networks, Internet and Intranet sites.

    PC (Macand Windows) integration.

    A wide base of developerswith powerful development tools.

    MessagePad 2000 Markets

    For the horizontal market, MessagePad 2000isa cost-effective hand-held

    computer for highlymobile professionals. It combinesa powerful processor,

    long batterylife, instant on, general businessapplications, and connectivityto

    both the desktop and the Internet.

    For vertical markets, MessagePad 2000isthe most extensible, mobile, and

    powerful hand-held computer for businessenterprisesseeking a cost

    effective solution to improve productivity, reduce costsand enhance theoverall qualityof service bycapturing information at the point-of-activity.

    Apple isfocusing on the Home Health Care vertical market. We are

    working with SIs, VARs, and ISVs/IHVsto ensure that a whole product

    solution isavailable.

    MessagePad 2000 Hardware

    The processor isa DEC StrongARM SA-110, which isa 32 bit RISC

    processor, running at 161.9MHz. The processor operatesat 1.7 volts.

    The displayisa 480x320 non-glare transflective grayscale LCD display

    with an electroluminescent backlight, covered bya touch-sensitive tablet

    which isoptimized for use with the pen. Part of the screen isused for a

    software button bar.

    The unit hasan 8MB ROM on a replaceable card, 1MB of DRAM for

    system use, and 4MB of Flash RAM for programsand data. There are two

    Type II PC card slotsthat support 3.3or 5.5volt operationsat up to 500mA.

    There isalso an internal serial connector that hasaccessto three serial lines.

    The case haspunchoutsfor an RJ-11modem jack next to the interconnect

    port and another punchout for a ribbon cable along the cover hinge. There is

    also a small amount of room inside the unit for a modem or other serial card.

    The unit hasa front-mounted microphone, speaker, and an AC adapter

    and Newton Interconnect port along the top. The internal serial

    connector can be routed to the Interconnect port. Also along the top is

    the infrared transceiver. There will be an optional keyboard that plugsinto

    the interconnect port.

    The unit can run on 4AA batteriesor an optional NiMH rechargeable

    batterypack. Batterylife isfrom 20to 62continuoushoursof use depending

    on backlight and PC card power requirements. The NiMH batteriesfast

    charge in about an hour.

    MessagePad 2000measures8.25L x 4.7Wx 1.25H (210.3mm x 118.7mm

    x 27.5mm) and weighsonly1.8lbs(0.82kg).

    Additional MessagePad 2000 Applications

    Available with MessagePad 2000 are a number of extra applications

    and servicesto provide a whole-product solution for our customers.

    Among these are:

    Newton Connection Utilityfor MacOS and Windows .

    NewtonWorksWord Processor (keyboard required).

    Newton Internet Enabler 1.1. Web Browsing software.

    Internet mail client software.

    Spreadsheet software.

    EMATE300

    eMate 300 Market

    The eMate 300hasbeen designed in cooperation with educatorsto meet

    the specificneedsof students. It worksasa companion to MacOS and

    Windows-based PCsin a Distributed Learning Environment.

    5

    Newton Technology Journal January 1997

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    6/24

    A Distributed Learning Environment isone that extendsthe reach of

    learning, and of computing technology, beyond the classroom to libraries, labs,

    homes, and the outdoors. The eMate 300srugged, portable design and long

    batterylife make it well suited for these situations. Itsideal for taking notesin

    a classroom or library, gathering data in the field, or getting on-line anywhere.

    The Information Appliance Division plansto introduce eMate 300in a

    varietyof areas. Building on Applesstrong presence in education, the first

    productswill be sold directlyinto the K-12school system. Consumer andUniversityproductsare expected to follow.

    eMate 300 Hardware

    The eMate 300usesa clamshell design which protectsthe case and

    keyboard when the unit isnot in use. Thick plasticswith reinforcing ribs, soft

    rounded corners, a steel chassis, and a shock mounted displayprovide

    protection against drops, twistsand other abuses. Field replaceable

    componentsensure minimal downtime if the inevitable occurs. The display,

    tablet, and backlight assembly, along with the keyboard and batteryare all

    field replaceable, and the total weight with batteriesisunder four pounds.

    The processor isan ARM 710a, which isa 32bit RISC processor clocked at

    25MHz. The displayisa half-VGA 480x320transflective grayscale LCD display

    with an electroluminescent backlight. The displayiscovered bya touch

    sensitive tablet, optimized for use with the pen, and a 17mm sub-notebook

    keyboard isbuilt in. The eMate 300doesnot use screen space for a software

    button bar, instead using a groupsof keysabove the numberson the

    keyboard asa button bar replacement. There are keysfor Extras, scrolling and

    overview, undo, find, and assist, and newkeyshave been added for docking,

    beaming, and closing slips.

    The unit containsan 8MB ROM on a replaceable card, 1MB of DRAM for

    system use, and 2MB of FLASH memoryfor programsand data. There isa

    single standard Type II/III PCMCIA card slot that supports5V cardsdrawing

    up to 500mA, and an internal RAM/FLASH upgrade slot. The device iscapable

    of using existing (12V) FLASH RAM cardsin a read-onlymode.

    The four AA cell NiMH rechargeable batterypack providesabout 28hours

    of high usage between recharges, and fast-chargesin about an hour. The

    batteryspace isdesigned to allowfor a larger four A cell batterypack, which

    approximatelydoublesthe capacity. There isa power adapter plug on the

    side in addition to charging contactson the base, and the Newton

    Interconnect port can power the unit and charge the battery. A LED mounted

    on the rear indicatesbatterycondition.

    The unit automaticallypowersoff when the lid isclosed, and powerson

    instantlywhen the lid isopened. There are also power and backlight control

    keyson the keyboard. Slidersabove the keyboard control the displaycontrast

    and the speaker/headphone volume.

    A built in infrared transceiver isincluded that iscompatible with

    existing Newton protocolsand also supportsIrDA at 115Kbps. A Newton

    Interconnect 26 pin connector isavailable asan alternative to a standardDIN9 serial/LocalTalk port. The unit containsa speaker and a

    headphone jack, in addition to audio line-out and line-in connectionsin

    the Newton Interconnect port.

    Simplified Interface for eMate 300

    To simplifythe Newton experience for studentsand ease

    configuration issuesfor teachers, a limited mode (Simple mode) is

    available on eMate 300. In Simple mode, the Newton filing interface is

    hidden, and the Extrasdrawer will show onlya teacher-defined subset of

    the available applications. Third partyapplicationscan determine if the

    unit isin Simple or normal mode, and adjust their interfacesaccordingly.

    Multiple Users on eMate 300

    To allowmultiple classesto easilyshare hardware, the eMate 300 now

    supportsmultiple users. Thisfeature isavailable in Simple mode only.When enabled, the unit requestsa name and optionallya password when

    the unit ispowered on. Once signed on, the user onlyworkswith their

    data; other users data ishidden.

    Teacherscan pre-define setsof users, or allowstudentsto create their

    own accounts, or the unit can be configured to require a password. A special

    teacher password unlocksfull accessto the machine.

    Applicationsmust be updated to support multiple users. We recommend

    that applicationsstore data for each user in a separate soup. Each application

    can find out the current user, and use the appropriate soup or otherwise

    adjust the visible data accordingly. Applicationsare notified when the user is

    changed or an account isdeleted.

    eMate 300 ClassroomConnectionTo ease integration into a classroom environment, Apple iscreating a

    specialized connection server intended to allowa classroom full of students

    to quicklyretrieve their work at the beginning of classand move it back to

    the server at the end.

    Unlike existing connection products, the server will support multiple

    connectionsat once. The user will connect via serial, IR, or LocalTalk and

    either upload the contentsof the eMate 300device to the server, or

    download data on a document-by-document basis.

    On the server, each Worksdocument will appear asa separate streamed

    object file. Developersmayuse desktop interfacesfrom Apple ( part of the

    Desktop Integration Librariesor DILs) to read and write filesin thisformat on

    the server. For example, XTND translatorscan be created to integrate these

    fileswith a varietyof desktop applications. Translatorsfor the built-in word

    processor and drawing applicationswill be included.

    Data from Newton applicationsthat are not integrated with Workswill

    also be available on the desktop, in a slightlydifferent file format. Each

    application soup will exist asa separate file on the desktop, and the same

    DILsinterfacescan be used to read and write those files.

    Conclusion

    The two newApple-labeled productsare nothing short of amazing.

    Besidesthe incredible hand-held computing power and gee whiz appeal,

    theyalso deliver newcapabilitiesfor growth in marketswhere Newton

    devicesare alreadypresent, and open up tremendousopportunitiesto

    expand into newmarketslike education and home health care. These newproductsin combination with the updated Newton OS will provide a solid

    foundation for future growth of the Newton platform.

    Copyright1997 Apple Computer, Inc. All rights reserved.

    Additional information about the Infrared Data Association can be

    found on-line at.

    January 1997 Newton Technology Journal

    6

    NTJ

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    7/24

    Newton Technology Journal January 1997

    7

    will be able to add toolsto existing stationery, and register whole newtypesof

    stationery. Newstationeryshould tryasmuch aspossible to maintain easyto

    understand interfacesand use established patternsfor user interfacessuch ascommand keyequivalentsand menus.

    About WorksLike the existing Notesapplication, Worksiswritten around the NewtApp

    framework for Newton applications. Those who have written stationeryfor

    the Notesapplication will find that writing for Worksisverysimilar.

    Worksitself issimilar to the Notesapplication in manyways. The

    headers, title slips, menus, statusbar, and overvieware all stock elements.

    There are some differences; however, for example Workshasscroll bars.

    Because documentslike papersor drawingsare commonlylarger than even

    the larger screen of the newdevices, usersneed scroll barsto navigate their

    work. A find and replace feature isalso newto the Worksframework.

    UsingWorksWorksisthe default backdrop application on the eMate 300 platform, so

    itsalwaysreadilyavailable. A common classroom scenario might have a

    student opening the eMate 300 to start work. A couple of keystrokes

    createsa newword processor document, and the student beginswriting

    their paper.

    When graphicsneed to be added, there are a couple of options. A quick

    sketch tool integrated with the word processor stationeryallowsa student

    to easilyinsert sketches. For more detailed drawings, a newdrawing

    document iscreated and edited. (The student can also use the drawing

    stationeryto create drawing documents.) When the drawing isdone, the

    student copiesthe result to the clipboard, switchesback to the paper, and

    pastesthe drawing in. Common clipboard formatsare used to aid in dataexchange between Worksapplicationsand other applicationsin the system.

    When the paper iscomplete, it can be printed from within Worksand

    turned in. It could also be beamed to another machine, either to hand it in

    to the teacher or hand it off to another student for collaborative work.

    If additional work isrequired to finish the document, it can be moved

    to a desktop computer via the classroom connection server. The document

    will appear on the desktop asa separate file, and translatorswill allowit to

    be opened in ClarisWorksand other popular desktop applications. Once on

    the desktop, additional finishing work such asadding color graphicsor

    incorporating multimedia content can be done.

    With the classroom connection server, documentscan be moved off the

    eMate 300 unit when work iscomplete. Rarelywill studentsin the classroom

    have more than a fewdocumentsat a time in Works, so the file management

    tasksin that scenario are minimal. Of course, Workswill be used outside the

    classroom and on other Newton devices, and the filing user interface is

    available in those casesto help with document management.

    Since the eMate 300 unitswill typicallybe more readilyavailable than

    desktop machines, more studentswill be able to do individual work more

    quickly. Worksisthe vehicle for thistype of productivitywithin the Newton

    OS.

    INSIDEWORKSThissection getsinto the technical detailsof extending Works. It provides

    a starting point for developersinterested in creating Worksapplications.

    When to use WorksSince Worksisa NewtApp application, deciding to add stationeryto

    Worksissimilar to deciding if you want to add stationeryto Notesor some

    other NewtApp application. Additionallya good candidate for Worksisany

    kind of document editor. If you can structure your stationeryso it allowsthe

    student to viewand modifysome type of document, then you maywant to

    use Works. Thisdocument can be anyunit of electronicdata, for example it

    might be a spreadsheet or a sheet of music. Also remember that though

    Workswill be available to anyone running N2 or eMate 300, itsprimaryfocus

    isthe education market. So consider the target market; will theyoften be

    using Works, or will theybe more often in another NewtApplication?

    Stationery with some extensionsTo add an application to Works, the DataDef & ViewDef need all the

    methodsand slotsnormallyused in stationery, plusadditional methods

    and slots. Note, Worksisdesigned to onlyuse one ViewDef, the default

    ViewDef. Other ViewDefsare allowed for routing.

    To take advantage of the additional featuresWorksprovides, the

    DataDefsand ViewDef needssome additional slotsand methods. In

    addition there are some APIsfor registering and un-registering toolswith a

    particular DataDef. Well walk through some typical actionsstudentswould

    do with Works, and explore the APIsinvoked.

    NewDocument

    When a student tapson the New button, Workschecksto see whatstationeryisregistered. To provide stationeryto Works, the standard

    stationeryAPIsare used. These are the global functionsRegDataDef,

    UnregDataDef, RegisterViewDef, and

    UnregisterViewDef. Check the Newton ProgrammersGuide

    (NPG) -System 2.0 for general information about these functions. Note, the

    DataDefssuperSymbol must benewtWorks.

    After a user selectsa particular piece of stationery, the title slip comes

    up. You can put information in thisslip. Worksmakesa conditional call to

    the DataDefsmethodInfoBoxExtract. Thismethod ispassed the

    target, a boundsframe, your ViewDef, and should return a shape. The shape

    can be anything. I t might be a small sketch of a drawing, or the result of

    calling MakeShape on some text summaryof the document. The shape will

    be appended to the bottom of other content that appearsin the infoBox.

    PreferencesOne of the next thingsa student might do istap on the information

    button and bring up the preferences. Additional preference information can

    be added bysetting aprefsslot in the DataDef. The frame in the

    prefsslot issimilar to a frame passed intoPopupMenuas

    documented in the NPG 2.0. Thisframe must also contain a

    prefsTemplate. Thistemplate containsthe viewtemplate needed

    for the user to set the DataDef specificpreferences. For example the

    continued from page 1

    Introducing Worksfor Newton

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    8/24

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    9/24

    Newton Technology Journal January 1997

    9

    The ViewDef hasa method,UpdateStatusBar, which iscalled

    when there isa change to the auxiliarybutton registry. Thiscan occur if a

    package installsor removesan auxiliarybutton for Works. The

    UpdateStatusBarmethod should update the two statusbar arrays.

    There isalso a newtAppBase method calledUpdateStatusBar

    which can be called when there isa need to recreate the statusbar. It will

    check for a currentlyactive ViewDef, and call the active ViewDefs

    UpdateStatusBarmethod.

    ProvidingHelpIf the student tapson the information button, and then selectsHelp, the

    first thing Workswill tryisto call the optional ViewDef method,DoHelp.

    DoHelpcan do anything special which needsto be done. IfDoHelp

    returnsloadHelp, Workswill also tryto load the help book.

    IfDoHelp isnot implemented, or ifDoHelp returns

    loadHelp, Workswill use two ViewDef slotshelpManual and

    viewHelpTopic to open a help book. ThehelpManual slot

    should have a help book frame. Check the Beyond Help DTS sample for

    information about howto create a help book. TheviewHelpTopic

    can be set to specifywhat topicto open to when the help book appears.

    Data StorageThe saving of the current entryisdone byWorks. Before saving the

    entry, the ViewDef methodSaveData iscalled. There are two times

    SaveData will be called. FirstSaveData iscalled periodicallyby

    Works. Secondlyif you want the entryto be saved call the method

    StartFlush, thiswill cause the methodEndFlush to be

    called after a period of time. The methodEndFlush will call the

    ViewDefsmethodSaveData.

    The methodSaveData ispassed the current entry. It can update

    slotsin the entry, and return a value indicating if the entryshould be saved.

    SaveDatashould returnnil if there isno reason to save the entry, or

    return the symbolNoRealChangeorTRUE to save the entry. If

    there have onlybeen lightweight changes,NoRealChangewill causethe entryto be saved, but the modification time stamp will not be updated.

    UsingTools in WorksToolscan be added for a specifictype of stationery. A ViewDef hasthe

    responsibilityfor displaying the toolsinstalled for that stationerytype, and

    correctlycalling the tool when it isinvoked.

    There are two Worksmethods, RegNewtWorksTool and

    UnRegNewtWorksTool to handle adding and removing tools

    from a type of stationery. The first ispassed a tool symbol, and a tool

    frame. The frame issimilar to the framesdocumented for

    PopupMenus, check the NPG 2.0 for more information. The

    toolsFrame hasa slot, dataTypeSymbol, which specifiesthe

    stationerytype it isregistered to. For Paper and Drawing a second key

    part of the toolsFrame iscmdFunc, the method ispassed a

    viewDefView (the main ViewDef view), and thenewtAppBase.

    There are a fewmore slotsneeded in the tool frame; check the WorksAPI

    documentation for more information.

    These methodswould typicallybe used in the install and remove

    scripts, and would be called like

    GetRoot().newtWorks:RegNewtWorksTools (toolSym, toolsFrame);GetRoot().newtWorks:UnRegNewtWorksTools(toolSym);

    There are two additional Worksmethods. The first,

    GetNewtWorksToolswhich returnsan arrayof the toolsbelonging

    to the specified stationerytype. The second,GetNewtWorksTool,

    takesa tool symbol and returnsthe tool frame.

    To be notified when toolsare added or removed, add a

    ToolsChanged method to the viewDef. If the viewDef isthe

    current view when there isa change in the toolsregister, the

    ToolsChanged method ispassed the action and the tool symbol.

    ViewChangesWhen the viewboundschange, for example if the horizontal scroller is

    no longer needed, or if the icon bar in N2 ismoved from the side to the

    bottom, Workswill call the ViewDef methodviewChangedScript.

    ThisViewDef method isalso called anytime a SetValue isdone on the view.

    Check the NPG 2.0 for more information.

    Two help slotsThere are two helpful slotsin the Worksbase view. The first is

    newtAppBase which containsthe Worksbase view. The second is

    viewDefView which containsthe current ViewDef view. Thiscan

    be nil if there isno currentlyactive ViewDef, for example when Worksisin overview mode.

    CONCLUSIONWorksisa built-in application framework that takescare of manybasic

    programming tasks, allowing developersto focuson the core work of

    creating a document editor. Works usersare guaranteed a consistent

    meansof creating and managing their work. Worksisreadilyavailable,

    making it the framework of choice for document-centricapplications, and

    especiallythose intended for the classroom.

    For more information on WorksFor more information on adding an editor to Works, check the

    reference document on the developer CD. A Workssample showsabarebonesframework needed to add an editor to Works. Thisisa good

    starting place for your development. You can change the name, the symbol,

    and then plug in some functionality.

    For more information on NewtApp & StationeryA good place to start for learning NewtApp isthe NewtApp overview

    article in the June 1996 Newton TechnologyJournal. The Newton

    ProgrammersGuide hasa chapter on NewtApp and a chapter on

    Stationery. Since adding to Worksisdone bycreating stationery, the

    chapter on Stationerywill be frequentlyused; however, the Stationery

    chapter buildson conceptsin the NewtApp chapter so read the

    introduction of the NewtApp chapter. The sample WhoOwesWhom is

    found on the developer CD and showshowto add stationeryto the

    Notepad. The sample Cardfile Extensions also showssome stationery

    techniquesin adding additional functionalityto the Namesapp.NTJ

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    10/24

    ANINTRODUCTIONTOTHEMESSAGEPAD2000 SCREEN

    The MessagePad 2000 platform providesa new screen for Newton

    applications. The new screen isone quarter VGA size (320x480 pixels)

    and provides16-level grayscale. Thisnew screen resolution provides

    exactlytwice the screen real estate over the MessagePad 120 and 130.

    Asa result, applicationsnow have greater freedom in their choice of

    how to present information.

    Along with the increased screen size comesgrayscale. The MessagePad

    2000screen providesapplicationswith a palette of 16graylevels. Where

    imagesonce had to be shown using dithered graylevels, the MessagePad

    2000screen providesreal graytones. In anticipation of possible future

    devices, the MessagePad 2000screen isactuallyworking with color values

    internally. The graylevelsare simplya mapping from color valuesto gray.

    The button bar haschanged aswell. Gone are the silk-screen buttons.

    Gone are the arrowbuttonsthat dont quite make sense when the screen is

    rotated. Gone isthe restriction to onlyrotate to a single portrait or landscape

    orientation. The MessagePad 2000screen can nowrotate to anyof the four

    possible portrait or landscape orientations. The orientation that worksbest

    can be used. Dont like the button bar at the left of the screen in landscape?

    Nowyou can put it on the right side. With the demise of the silk-screen

    buttonscomesanother handyfeature. Anyapplication can be put on the

    button bar. Simplydrag the iconsyou dont want on the button bar into the

    ExtrasDrawer and drag the iconsyou do want onto the bar.

    What it looks like

    Hereswhat the newscreen lookslike in landscape mode with the icon

    bar on the right.

    < < Insert picture of MessagePad 2000screen

    here, call out notable features: Arrowsrotate with

    the screen, Assist off the button bar, Formulas

    on> >

    Howto look good

    There are a fewissuesthat developersmusthandle properlyin order to have their applications

    look good on the MessagePad 2000display. The

    main issue isdealing with the increased screen size

    and the soft button bar. Depending on howan application sizesitsmain view

    it mayend up using onlyhalf the screen, or it mayend up using the entire

    screen with interface elementsin strange places.

    Aslong asapplicationsfollowthe recommended techniquesfor sizing the

    base view, most problemscan be avoided. A naive wayof sizing your base

    viewisto set the viewBoundsto hard numbersand to assume that the

    screen will be the right size to accommodate the view. When the MessagePad

    110wasreleased, the screen size changed. Thiscaused anyapplication with

    hard viewBoundsto look odd on the newscreen size. Putting a

    viewSetupFormScript in your applicationsbase viewisthe right wayto avoid

    problemswith the screen size. Heresan example.

    func()begin

    local maxWidth := 200;local maxHeight := 300;local params := GetAppParams();self.viewBounds := RelBounds(

    params.appAreaLeft,params.appAreaTop,Min(maxWidth, params.appAreaWidth),

    Min(maxHeight, params.appAreaHeight));end

    Byusing a maximum size that isreasonable for your application, you

    can be sure that all your careful layout wont be ruined bya suddenly

    increased screen size.

    Viewjustificationsalso need to be carefullyplanned so that increased

    screen size doesnt cause sub-viewsto suddenlychange position.

    Workingwith Gray Scale

    Letsnowturn our attention to the grayscale capabilityof the MessagePad

    2000screen. Grayscale isone of those featuresthat can differentiate a run-of-

    the-mill application from one thatsgenuinelypleasing to the eye.

    The newgrayscale screen allowsapplicationsto displaygrayshapes,

    picturesand text. Along with the grayscale capabilitiescome several new

    featuresfor Newton QuickDraw. These newfeaturessupport anti-aliased

    bitmaps, Clipboard support and several newshape manipulations.

    GrayQuickDrawcan directlydisplay1, 2or 4-bit color images. Picturesor

    shapesthat use 8, 16or even 32-bit color can also be drawn byinterpolating

    the color valuesasgrays. One thing to keep in mind isthat sizesgo up

    dramaticallyaslarger bit-depthsare used for pictures.

    The Platform file for MessagePad 2000 will be able to directlyimport

    color picturesinto packagesto be displayed asgray. In the case of

    bitmaps, multiple versionsof the bitmap at 1, 2, 4, 8, 16 or 32 bitsper

    pixel can be included in the picture. The appropriate image will be

    displayed to match the displaycapability.None of the built-in protoshave been changed to take advantage of the

    newgraycapability. There are a couple of reasonsfor this. The first and most

    obviousreason isspace. Protosthat use graywill simplytake up more space

    than the current versions. More importantly, existing applicationswont know

    that grayisbeing used. The resultscould be visuallyodd if the grayareas

    didnt blend reasonably. There isnothing preventing an application from

    defining itsown protosthat use grayto good effect.

    All shapescan now include predefined color valuesfor the gray

    tonesor graypatternsthat will be tiled into the shape. Fill and pen

    patternscan be defined.

    January 1997 Newton Technology Journal

    10

    MessagePad 2000 Screen Size and Grayscale Graphicsby Bruce Thompson, Apple Computer, Inc.

    New Product Features

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    11/24

    Newton Technology Journal January 1997

    11

    with a mask. Thisallowsbitmapsto have odd shapesbut to still occlude the

    background (more or lesslike Macintosh icons).

    Ink isnoweasier to handle. First of all, you can get the list of point in

    either X,Y order or in Y,X (previouslythe onlywayto get the points),

    whichever suitsyour use of the data. Also, the number of pointsobtained can

    be tuned byspecifying a distance between points.

    Selection handlesare nowsupported through the stylesframe for a

    shape. You can also determine whether a point hitsthe selection handle. Thishelpsapplicationsthat support direct user manipulation of shapes.

    Summary

    The MessagePad 2000 screen providesa lot of newscreen real estate

    for applicationsthat need larger areasto work with. The newgray

    capabilitiesand drawing function open a number of newarenasfor

    application and user interface design.

    Monochrome bitmapscan be anti-aliased byshrinking and gray

    interpolation. Thisisespeciallyuseful for fax or other scanned image viewing.

    If the bitmap being interpolated isnot a bitmap (it hasmore than one bit per

    pixel) then anti-aliasing isnot performed.

    A number of functionsare nowprovided for working with RGB data. A

    drawing application can pretend that it isrunning on a color displayand the

    color valueswill be interpolated into graylevels. Byworking with RGB values

    an application can be readyfor color in the event that future Newton devicesprovide color support.

    There have been a number of capabilitiesadded that have nothing directly

    to do with the newgrayscale screen. These newcapabilitiesmake life a little

    easier for applicationsthat are doing a lot of graphicswork.

    Clipboard data can nowbe converted into Shapes. Thismakesit easier for

    applicationsto allowusersto transfer shapesbetween applications.

    Shapescan nowbe directlyflipped or rotated to allowapplicationsmore

    freedom in howshapesare manipulated. Bitmapscan nowbe displayed

    Developer Training Update

    Newton Training

    OUREXCELLENTTIME-SAVINGCOURSESAREMOVINGTOWHEREYOUARE!

    Asof January1st, 1997, Newton Developer Training hasexpanded to offer

    two courses Newton EssentialsAND Newton Communications and is

    nowcloser to your neck of the woods. See the schedule belowand check

    outhttp://devworld.apple.com/dev/newton/devservices/nsgtraining.html>

    for registration information, including newlinksto earlier versionsof our

    FREE on-line Newton Programming: Communications2.0 and Newton

    Essentials2.0 courses. Your feedback on these coursesiswelcome!

    Newton Programming: 2.0 Essentials

    Learn howto develop applicationsfor Newton devicesusing the state-of-

    the-art development environment, Newton Toolkit for Macintosh and

    Windows, in combination with a verypowerful, small, robust, object-oriented

    language, Newtonscript. The use of Newton Toolkit letsyou interactively

    develop your applicationswithout having to execute sequential edit, compile

    and link cycles. In addition, human interface guidelinesfor developing on

    PDAsare discussed.

    Instructors: Neil Rhodes, Bill Worzel, or Adrian BrowneDuration: 5 days

    Tuition: $1500

    Newton Programming: 2.0 Communications

    Learn the fundamentalsof Newton Communications. Using a self-paced

    mentored approach, we cover information for Newton programmerswho

    want to add communicationscode to their applications. Studentswill have

    accessto code, articles, referencesand labs. A qualified instructor isavailable

    to work one-on-one with anyone having specificquestionsor problems. In

    addition, a module on the Newton Internet Enabler will be presented.

    Instructors: Neil Rhodes, Bill Worzel, or Adrian BrowneDuration: 5 daysTuition: $1500

    SCHEDULEClass Location Date Cost/Student Registration

    2.0Essentials Ann Arbor, MI 1/27/97 $1500 313-439-3828

    2.0Essentials Palm Springs, CA 2/24/97 $1500 909-793-5995

    2.0Comms Ann Arbor, MI 3/17/97 $1500 313-439-3828

    Arroyo Software and Calliope Enterprisesare both long-time providersof

    Newton programming training for Apple. Both companiesprovide instructors

    who are experienced Newton programmersaswell asexpert trainers. Arroyo

    Software authored the Newton CommunicationsCourse and Calliope

    Enterprisesauthored the Newton EssentialsCourse, both for Apple

    Computer, Inc. Educational and group discountsare available.

    Onsite training can be arranged both within the United Statesand

    worldwide. Further information about both companiesisavailable

    upon request.

    Arroyo Software214West Main Street

    Milan, MI 48160

    (313) 439-3828

    sobel@ arroyosoft.com

    http://www.arroyosoft.com/

    Calliope Enterprises

    700East RedlandsBoulevard, Suite 154Redlands, CA 92373

    (909) 793-5995

    nrhodes@ pobox.com

    http://www.pobox.com/~ neil/training.html

    NTJ

    NTJ

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    12/24

    INTRODUCTION

    These articlesfocuson information useful to those who have mastered

    the basicsof Newton data storage APIs. Theyassume that the reader is

    alreadyfamiliar with NewtonScript and Newton data storage conceptsin

    the Newton ProgrammersGuide (NPG) and hassome experience

    writing Newton applications.

    The seriesconsistsof three articlesentitled, Data Structures, Entry

    Caching, and VBOs. The articlesinclude some implementation-level

    detailswith which you can optimize and design your own applications.

    The first article in thisseriesfocuseson internal soup data structuresand

    howto use them.

    Under the HoodBynow, you have alreadyused soup methodslike

    soup:AddXmit(entry) and

    unionSoup:AddToDefaultStoreXmit(entry) .

    However, you maynot knowwhat goeson under the hood in the

    Newton OS to store and retrieve soup entries.

    Without anyextra data structures, finding an entryin a soup would be as

    inefficient assearching for a specificbusinesscard after a fan blewyour

    businesscardsaround your office. You might not be happyif you had to

    look at almost everycard before finding the right one.

    The pick itemsin a random order algorithm would be especiallyslow

    in the Newton OS because reading a soup entryfrom the store hasa high

    overhead. While writing a NewtonScript frame to a soup, the frame is

    flattened into a binaryobject, similar to the processused in the

    Translateglobal function. While reading in a soup entry, the system

    readsthe flattened frame from the store and un-flattensthe frame into

    NewtonScript memory. Because of the un-flattening code and the memory

    management required to create the NewtonScript objects, reading in a soup

    entryisslow. The EntryCaching article later in thisserieswill discussthe

    detailsof reading in entries.

    The high overhead for readingin soup entrieswouldnt be asmuch a

    problem if we read in an entryonlywhen it wasthe next item we wanted. You

    might be wonderingwhywe cannot read in all the entriesinto memoryand

    sort them in place, like you might do on a desktop computer. Due to cost andmobilityrequirements, current Newton devicesdont have enough memoryto

    hold all the data of an average-sized soup. Instead, creatinga cursor findsonly

    the first entry. If you send cursor messageslikecursor:Next() and

    cursor:Prev(), the system searchesfor adjacent entries.

    In order to help your application minimize reading in entries,

    Newton soupsmaintain separate data structures. The system stores

    these data structuresin additionto the entries, and these data

    structuresdo not order or modifythe entriesthemselves. These data

    structuresare called indexesand tags.

    Indexes: fromAA to zzThe most useful soup data structure isthe index. An index provides

    quick accessto soup entriesaswell asa meansof retrieving entriesin a

    defined order. A designated value from each item, called the index key,

    definesthe itemssort ordering. For soup indexes, the keyvalue could

    be derived from a slot value or multiple slotswithin the entry. Your

    code can use the index to find individual soup entriesquickly(if you

    know the keyvalue) or iterate through entriesin a sorted order without

    reading in unneeded entries.

    Most Newton applicationscreate indexeswhen the soupsare created. For

    instance, a bank check application might specifyan integer index on a

    checkNumslot. Thismeansthat the soup entryscheckNumslot

    containsan integer that providesthe keyvalue for that index. Thisindex allows

    the application to retrieve the entriesin check number order (ascendingor

    descending) or quicklyfind a check with a specificcheckNum.

    The system maintainseach index assoup entriesare added, deleted or

    changed. Or, you could add or delete indexesto soupswhen entriesare

    alreadyin the soup. If you create indexesfor soupsthat alreadyhaveentries, the system must iterate through all the entries, examine the key

    values, and place them in the index.

    Note that some applicationsthat add manyentriesachieve better

    performance if theydo not set up indexesin advance. If an application

    receivesdata from a remote server and must add manyitemsto a soup,

    updating the index information when adding everyentrycan slowdown the

    connection with the server. If connection time isexpensive, an application

    could set up a soup with no indexes, add manyitems, and then add the

    index after the connection iscomplete. Even without expensive connection

    times, adding manyentriesto an emptysoup will be faster if you create

    indexesafter adding all the entries.1

    Because the system storesindex information separate from the entries

    themselves, we maycreate multiple indexesto represent different sortorders. Multiple indexesare useful if you want to retrieve the data in two

    or more different sort orders.

    If you wanted a single sort order based onmultiple slots, youd use a

    multi-slot index. For example, you could retrieve employee namesin

    January 1997 Newton Technology Journal

    12

    Data Structures: Storing and Retrieving part 1 of 3by J. Christopher Bell , Newton Developer Technical Support, [email protected], http://www.doitall .com

    Advanced Techniques

    1If the soup alreadycontainsentries, based on the number of entriesalreadyin the soup, it mayor maynot be faster to 1) remove the index 2) add many

    entries, 3) re-add the index. Or, you could add newentriesto a temporarysoup (with no indexes) during connections, and move the entriesto the indexed

    soup afterward (thismight take longer overall, but it might allowshorter connection timesif that wasimportant for your application)

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    13/24

    Newton Technology Journal January 1997

    13

    alphabetical order bylast name (the primarykey), but use the first name (the

    secondarykey) to decide ordering of employeeswith the same last name.

    Multi-slot indexesdo not define multiple indexes. Instead, the index

    extractsthe keyvalue for the index from two or more slots. Although thisis

    oversimplifying the implementation, you can think of it ascreating

    concatenated valuesfor use asthe keyvalue for that entry. For instance, if

    the entriesuse separate slotsfor last namesand first names, the system

    extractsboth slotsfrom each entry, creating single index keyvalueslikeSimpson*Bart which define the sort order.2

    A common misconception isthat thisisequivalent to multi-index queries,

    which are not currentlysupported. Multi-slot indexesdefine a single sort

    order. When you use a multi-slot index, you must create the entire index with

    the proper sort order specification before querying with that index.

    An example of thismisconception istrying to make an efficient query

    with the last-name-first index described above, retrieving all people withfirst

    namesbeginning with the lettersA through C. You can think of the names

    aslisted on a sheet of paper sorted bylast name and then first name.

    Because there isonlyone sort order, the people with first namesbeginning

    with D through Z are interspersed throughout the sort order. The many

    undesired entriesmust be examined and then skipped over using a filtering

    method (which we will discusslater in thisarticle), which isinefficient.

    Indexes are B-treesIndexesare implemented in a balanced tree structure called a B-tree.

    The important thing to knowabout B-treesisthat finding an entrybased on

    a keyvalue isdescribed asO(log n) in big oh notation (pronounced order

    log n) , where n isthe number of indexed entries. Moving from one item to

    the next item in sorted order can be done in O(1), or constant time. For

    more information about big O notation and B-trees, see the cross-references

    section for more information (Baase, Sedgewick).

    For instance, let uscompare it to a hypothetical brute force index

    designed to minimize reading in entries. Imagine we created a simple index

    bystoring each entryskeyvalue and the soup entryunique identifier

    (unique ID) in elementsof an unsorted array. We could iterate over the

    unsorted arrayfor a particular keyvalue but we might search most of the

    unsorted arrayfor the desired keyvalue. In comparison to thisbrute force

    index search time of O(n), a real soup index requirestouching onlya small

    fraction of nodesin O(log n) time, and subsequent searchesfor the next or

    previousentryin sorted order are O(1) time.

    Note that for multi-slot indexes, search speed isapproximatelythe

    same asfor single-slot indexes. Multi-slot indexesuse the same structure

    asfor single-slot indexes, except that the system takesthe keyvaluesfrom

    multiple slotsin the entry.

    When Entries Participate In Indexes

    For single slot indexes, if the keyvalue isnon-nil, the entrywillparticipate in the index. I f the keyisnil or not present, that index will not

    reference that entry.

    For multi-slot indexes, the entrywill participate in the index if anyof the

    sub-keysare non-nil. I f an entryisin a multi-slot index but a sub-keyis

    nil, it will sort before anyotherwise identical item with a non-nil value

    in that sub-key. For instance, in the multi-slot index for the employeessoup

    described above, the following entrieswould appear in thisorder.

    {last: nil, first: Madonna} // nil value for primarykey

    {last: Simpson, first: Bart}

    {last: Smith}// nil value for secondary key

    {last: Smith, first: Abigail}

    Urban Legends About IndexesHere are fewcommon misconceptionsabout indexes.

    1) Indexes do not order the entries themselves. Soup entriesthemselvesare

    stored asflattened framesin no defined order. The system copiesthe

    keyvaluesfrom the entriesinto the index structure separate from the

    soup entriesthemselves.

    2) Indexes are not free. Indexestake time to maintain when entriesare

    added, deleted, or changed. Indexestake space on your internal or PC

    Card store. Indexesare not automaticallyadded for all slotsin soups;

    you must add one index for each desired sort order.

    3) Indexes do not provide instant access to soup entries. Finding an entry

    based on itskeyvalue takesO(log n) time (although it takesO(1) time

    to find the next/previousentryin the index). Note that if you are not

    filtering out unneeded entriesin the index (see the next section), index

    operationsare veryfast, low-level operationsin comparison to calling

    NewtonScript functionsor reading in entries.

    4) Multi-slot indexes are not multi-index queries. A multi-slot index must

    alreadybe created for a particular set of slotsbefore querying the index.

    When querying that index, there isonlyonesort order and onlyonekey

    value derived from multiple slots.

    Filtering: All You Ever Think About is SetsSome applicationswant to queryusing an index but retrieve entriesonlyi

    theysatisfycertain criteria. You might saythat you are looking for a certain

    set of entriesin the index. For instance, you might want to find the set of all

    employeeswho are married, dont have children, have the ABC health plan,

    but dont have a dental plan. You could add an index for everypossible set-

    based query, but it would cost both speed and store space to maintain those

    indexes. Instead of using indexesto filter out unwanted itemsanddefine an

    order, you can use an index to define a sort order ( and a range) and then

    filter out unwanted itemswith one of the queryfiltering methods.

    When used on their own, filtering methodstake O(n) time to find the

    next entry, since the system might examine and reject 999 out of 1000 items

    in the index before finding the first item in the desired set. Filtering

    methodsdo not create a sort order. If you want to retrieve the entriesin a

    sorted order (or limit the range with querylimiterslikebeginKeyand

    endKey), youmustcreate an index.

    The simplest and least efficient filtering method isavalidTest. AquerysvalidTest function must determine whether the entryisor is

    not in the appropriate set. It isthe most powerful filtering method because

    it can run an arbitraryfunction to determine whether the item should be

    filtered out. However, it isslowbecause the functionsexecute a

    2You can also define directionalityfor multi-slot indexes. For instance, you could retrieve employee data sorted bylast namesalphabetically(ascending), and

    when there isa tie, showthe employee salarysorted reverse alphabetically(descending).

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    14/24

    January 1997 Newton Technology Journal

    14

    NewtonScript function and usuallyrequire the system to read in everyentry.

    Reading in entriesisslow, so use thisasa last resort.

    A faster filtering tool istheindexValidTest. Thisissimilar to a

    validTest, except that the NewtonScript function usesthe index

    key(s) instead of the entryitself. Thisisfaster because the system will not

    read in the entry. However, it islessflexible because the

    indexValidTestcan onlyuse the index key(s). Also, because index

    keysmaybe truncated after 80 bytes, theindexValidTestmust beprepared for sub-keysto be truncated or missing.

    Tags: Not Just For LuggageAn even better solution for filtering entriesisto use tags, Boolean flags

    you can attach to soup entries. Tagsqueriesprovide a wayto test these

    Boolean flagsusing a simple syntax. Instead of providing a NewtonScript

    function to determine whether the item isin the set, the system checks

    the tagsand determineswhether to filter out the item. A queryjust using

    tagstakesO(n log m) time to iterate through an index looking for

    appropriate tags, where n isthe number of indexed entriesand m isthe

    number of entriesin that soup with at least one tag. However, it isvery

    fast ( the constant islow) due to the help of an extra low-level data

    structure created especiallyfor tags.

    If we added the appropriate tagsto the soup entries, we can create a

    tagSpec to search for the example employeeswho are married, have

    no children, have the ABC health plan, but dont have a dental plan.

    myQuery := unionSoup:Query({tagSpec: {all: [isMarried, hasABCHealthPlan],none:[hasChildren,hasDental]

    });

    Since all the tagsare Boolean, the tagsmechanism can store tagsfor

    each entryusing compact bit fields. The system storesthese bit fieldsin a

    data structure called a tagsdata structure3. The tagsdata structure uses

    an entryidentifier asthe keyvalue for a B-tree, with the tagsbit fieldsas

    the data within each node.

    Asyou might guessfrom our earlier discussionsof B-trees, the system

    requiresO(log m) time to find the tagsfor the entryand O(log n) time to

    find the first entryin the current index. Note again that n isthe number of

    indexed entriesand m isthe number of entriesin that soup with at least

    one tag. In a querythat just usestags, the system must repeat thisprocess

    for potentiallyeveryentry(O(n) time) until yourtagSpecmatchesthe

    tagsfor an entry. Thismeansthat the system takesO(n log m) time to find

    the first match for a tagsquery. You might note that thismaysoundslower

    thanvalidTests. However, a tagsquerydoesnot need to execute

    NewtonScript code, read in entries, or manipulate NewtonScript objects,

    and the system usesefficient index and tagsdata structuresto test entries.

    Overall, the result ismuch fasterin comparison to anyother filteringmethod we have discussed so far because of these extra data structures.

    Textual QueriesBecause it issimilar to the other filtering typesalreadydiscussed, I want

    to brieflymention textual queries. Like the other filtering methods, textual

    queriesdo not define an order. If you want to retrieve the entriesin a sorted

    order (or limit the range with querylimiterslikebeginKeyand

    endKey), youmustcreate an index.

    The most important thing to note about textual queriesisthat stringsare

    not flattened with the rest of the soup entry. Theresa separate data

    structure for storing strings. Unlike the other soup data structuresusing for

    retrieving data, thisdata structure iscreated for all stringsand requiresno

    extra store space nor explicit creation.You can think of the stringsstored asone long concatenated string for

    each soup entry. While writing entriesto the store, the system writesstring

    data (from anywhere in the entry) to a separate place on the store.

    During textual queries, the system need not examine individual frame

    slotsnor read in the entry. Because of this, the system can perform textual

    queriesat a lowlevel using thisstructure. Textual queriesmight potentially

    search all indexed entries, but the text-searching speed isveryfast in

    comparison to filtering mechanismsthat use NewtonScript functionsto

    evaluate whether an item should be filtered out.

    If Speed Matters: Some RawDataTo compare different filtering methods, here issome speed data with

    multiple methodsand a similar search. The test isbased on a 1000 entrysoup with about 700 bytesof data in each entry, including 200 bytesof text,

    and string searchesare performed on a 40 charactermyStringslot.

    Each search answersthe question: howmanyentrieshave itsmyString

    slot start with the stringblah?

    Note that all searcheswere designed to search the entire soup asthe

    worst case scenario and these timing samplesapplyonlyto thisparticular

    set of test data. Speed of particular filtering methodswill varybased on your

    data, the complexityof your searches, and on each Newton device. These

    testswere performed on a MessagePad 120 with Newton 2.0 OS.

    AvalidTest querytakes2225 ticks. ThevalidTest read

    in everyentryand tested themyString slot with the

    BeginsWith function.

    AnindexValidTestquerytakes354 ticks. The

    indexValidTest tested the indexedmyString keyand tested it

    with theBeginsWith function.

    3Youll see other documentation that callsthese tagsindexes, but theyare not indexesin the wayweve been discussing them. You cannot use them to

    retrieve itemsin a sorted order. However, to use tagsyou must treattagSpecsasindexSpecswhen used with

    store:CreateSoupXmit(...) orsoupOrUnionSoup:AddIndex(...).

    The most important thing to

    note about textual queries is

    that strings are not flattened

    with the rest of the soup entry.

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    15/24

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    16/24

    January 1997 Newton Technology Journal

    16

    CONCLUSIONHere are the thingsthat are the most important to remember.

    1) Indexesare required to retrieve data in sorted order.

    2) Indexesare stored asB-treesand take O(log n) to find an entry.

    3) Multi-slot indexesdefine a single sort order and use a single B-Tree.

    4) Tagsare important for retrieving sets, but are not indexes. Tagsdo not

    define a sort order.

    5) Tagsare used in conjunction with an index, even if it isthe default index.6) Indexesand tagsdata structuresarent free. Theytake time and storage

    space to maintain, so decide carefullywhat you need.

    I want to reiterate that if you are ever in doubt of howto optimize your

    application for speed and/or size, experiment with several different

    implementations. In the wordsof the composer Cole Porter, Experiment.

    Make it your motto dayand night.

    Thanks to Bob Ebert for his help with this article.

    Cross-references

    Apple Computer, Newton Programmers Guide(NPG) 2.0 andNewton Programmers Reference 2.0, 1996. Apple Computer, Inc.Available on-line on Newton Developer CD-ROMs. The NPG 2.0 will also be

    published in hard copy by Addison Wesley.

    Baase,Sara,Computer Algorithms, 1988. Publisher: Addison-Wesley.Find more information on-line at http://heg-

    school.aw.com/cseng/authors/baase/compalgos/compalgos.html and

    http://www.amazon.com/exec/obidos/ISBN= 0201060353

    Engber, Michael,Lost In Space articleandLostInSpace code, 1995.Publisher: Apple Computer, Inc. Find them on Newton Developer CDs.

    Porter, Cole,Experiment.Copyright 1993 (Renewed) by Warner Bros.Find more information about Cole on-line at my Cole Wide Web,

    http://www.doitall.com/cole

    Sedgewick, Robert,Algorithms,1988. Publisher: Addison-Wesley. Findmore information on-line at http://heg-

    school.aw.com/cseng/authors/sedgewick/algo-in-c/algo-in-c.html and

    http://www.amazon.com/exec/obidos/ISBN%3D0201066734

    Agreat deal of our developersare involved in health care applications. TheNewton Group recognizesthis, aswell asthe natural fit, for Newton

    technologyin health care and the size of the health care market. Add to thisthe political pressureson health care to improve or to maintain the qualityof

    care while cutting costs; and you have a compelling argument whythe

    Newton OS hasa chance at reallymaking a positive contribution to the way

    health care isdelivered.

    In order to establish the Newton OS asthe premiere Operating System

    for mobile computing in health care, the Newton SystemsGroup hasformed

    a health care group comprised of full time resourcesaswell asmarketing and

    salessupport. In thisarticle, I will outline the eventsthat lead to the

    formation of the health care group, the groupsplanned activitiesfor thisyear,

    and howwe plan to collaborate with developers.

    Focus On Home Health CareThe majorityof the health care groupsfocus, in the remainder of 1996

    into 1997, will be on the home health care market. Thisisa sub segmentof the overall trillion dollar health care market that isgrowing at a

    remarkable rate. Currently, home care comprisesapproximatelythree

    percent of the overall health care budget. Bythe year 2000, thisshould

    reach ten percent. The home care market hasbeen growing at an annual

    rate of more than 25% over the last five yearsand isanticipated to growat

    15%+ annuallyuntil the year 2000.

    In the United States, home care isthe health care that istypically

    delivered in the home setting bynurses, technicians, and therapists. It can be

    in the form of wound care, physical therapy, infusion (IV) therapy, dialysis, or

    assistance in activitiesof dailyliving; such asbathing.

    NSGscommitment to Health Careby Vernon W. Huang, M.D., Apple Computer, Inc.

    Marketing Strategy

    NTJ

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    17/24

    Newton Technology Journal January 1997

    17

    These nursesand allied health personnel, generallydo all of their record

    keeping on paper and perform a great deal of redundant data entry. A

    typical nurse might spend two and a half hoursper dayon paperwork.

    Some attemptsto automate these mobile professionals, have been made:

    using laptops, slate type computers, or proprietarydevices. However, there

    iscurrentlyno clear leader in the industry. Thus, there existsa unique

    opportunityfor Newton developersto deliver a whole product solution

    comprising of Newton OS devicesremotelyconnected to a back end server.Asin most dispatch applications, a real time connection isnot usuallya

    requirement. Data can be exchanged in batch sessions, usuallyvia modem.

    In order to achieve our goal, to be the recognized force in health care and

    home health care, the Newton SystemsGroup hasallocated significant

    resourcesto the Healthcare SolutionsGroup. Manyof these activitiesinvolve

    co-marketing or collaborating with our developers.

    NewHealth Care Solutions Guide

    We are currentlyputting the finishing toucheson our,Newton in Health

    Care Solutions Guide. Unlike the previousyears, our newguide will be

    professionallyproduced byan agency. It will be printed in four colors. The

    SolutionsGuide will cover successstories; home health care; medical

    education, reference and research; general medical software and developer

    toolsand SIswith healthcare experience. Revisionswill be made in the

    second and fourth quartersof 1997. Developersinterested in receiving copies

    of the Health Care SolutionsGuide or inclusion in future editions, shouldemailand place the wordssolutions guiderequestorsolutions guide entr y in the subject of their email.

    DistributingYour MarketingMaterials

    The SolutionsGuide will be onlyone piece of printed material that

    we will be sending to our potential customers. We are also creating a

    health care folder which will contain the SolutionsGuide, white papers,

    and developer supplied materials. If your companyhasa medical product

    or providescustom programming servicesfor health care, we can help

    you distribute your marketing materials. To participate in thisprogram,

    mail a sample of your letter size glossyproduct sheetsto

    Dr. Vernon HuangNewton Systems GroupOne Infinite Loop MS 305-3ACupertino, CA95014

    Well do our best to include your materialsin our mailings, but cannotmake anypromisesuntil we see the content.

    Industry and Trade Shows

    In addition to the showsthat the Newton SystemsGroup traditionallyhas

    representation at (Comdex, MacWorld) , the Health Care SolutionsGroup will

    be participating in four showsthisyear beginning with the Annual Meeting of

    the National Association of Home Care (NAHC) in Nashville, TN. Developers

    interested in participating in our booth space at these shows, should make

    sure that we knowof the statusof your current products. In addition, your

    productscan be demoed at these showsand at other salesopportunitiesif

    the Health Care Group hasa sample copyof your application, even if your

    companycant participate in person.

    Assistance EngagingCustomers

    Often timeshaving a representative from Apple along can help assuage

    fearsthat a potential customer mayhave about the Newton Groups

    commitment to the health care market or Apple Computerscommitment to

    Newton. Please be certain to let usknowif you have an opportunityto make

    a high level presentation to a qualified health care customer. With Time and

    resourcesbeing what theyare, we cant alwayspromise to be able to go in

    with you in person, but well do what we can to assist your efforts.

    On-Line Marketing

    Asthe Newton Web page getsoverhauled, we plan to launch a Newton in

    Health Care web page. At thissite, customerswill be able to read about

    successstoriesand viewan on-line version of the Health Care Solutions

    Guide with linksto the developershome pages. Staytuned on howto

    participate in thisopportunity.

    Were Here For You

    Aside from our commitment to home health care, we are determined to

    make the Newton OS the standard in all aspectsof health care deliveryand

    education. Our Bookmaker and our Presstechnologieshave alreadystarted a

    revolution in electronicmedical references. Several of our developersare

    achieving significant first or second round financing and are growing at a

    tremendousrate. I f there isa segment of the health care market that you feel

    we are neglecting, or if you have additional ideasin howwe can co-market

    solutions, please send email to.

    NTJ

    In order to achieve

    our goal, to be the

    recognized force in health

    care and home health care,

    the Newton Systems Grouphas allocated significant

    resources to the Healthcare

    Solutions Group.

  • 7/28/2019 Newton Technology Journal: Volume 3, Number 1

    18/24

    This article summarizes the technical informationthat was presented at the Newton TechnologyConference 1996.Additional information on each ofthese topics is provided elsewhere in this issue.

    TEXTENGINE

    The Newton "edit view" viewclasshasbeen part of the standard Newton user

    interface since Newton 1.0. It wasextended in Newton 1.3to handle deferred

    recognition, and then extended in Newton 2.0to handle pictures. However, it

    islimited assimplya container for unrelated viewchildren, not easily

    extensible asa complex word processor.

    In Newton 2.1, we introduce a newtext-editing engine called

    protoTXView. Thistext engine allowsembedded graphicswithin text,

    paragraph formatting featuresfound in desktop word processors, and

    increasesthe maximum size of documents(stored in Virtual BinaryObjects).

    The new text engine allowsparagraph-by-paragraph style

    information like left and right indents, complex tab stops( left, right,

    and decimal) , and lineSpacing. An optional " ruler" user interface allows

    modification of these settings. Thisparagraph-by-paragraph information

    iscalled "ruler information."

    Methodsare provided for getting and setting information about styles

    (bold, italic, underline), ruler information, and text. These APIsare based on

    the conceptsof rangesand runs. Rangesrepresent placeswithin the text,

    represented bycharacter offsets, like { first: 0, last:5} . Runsrepresent style or

    ruler information with arraysof valuesrepresenting pairs: numbersof

    charactersand the value. For instance, [3, fontSpec1, 5, fontSpec2]

    representseight charactersof style information, with three charactersof

    fontSpec1and 5charactersof fontSpec2. Run arraysare used to get and set

    style and ruler information.

    To use a basicprotoTXView, just add the required viewslots(viewFlags,

    viewJustify, and viewBound