---
title: WWDC2003 Session 202
framework: wwdc
role: article
path: wwdc/wwdc2003-202
---

# WWDC2003 Session 202

## Transcript

Kind: captions Language: en I'm here to sort of announce a sort of special session that we have planned for you guys today which is session 202 technology magical keynote and we actually do something a little bit different for WT what we're going to be doing is we're in bjs is basically talking about an application one of our applications keynote and for many of you are probably aware that in January of this year we launched our own presentation product which uses a lot of maca Liston technology to do some incredible work in terms of bringing really high quality high production values and ease of use to the act of doing presentations and as an evangelist at Apple I do a lot of presentations and i can tell you i've enjoyed using this tool this application every time for every presentation I've done since January so we wanted to actually have an opportunity for the keynote team to sort of tell developers about how they made keynote happen and particularly which technologies they adopted because I think it's a very very interesting story and you know so the really interesting thing we have here is that we're going to be talking about an application rather than a technology at wwc now there's 175 sessions many of those are going to be talking about new technologies technologies that have been improved for Panther and you know it's really specific down low level to specific technologies and one of the things that I encounter often was working with developers is that it's great to see the technology the API in a presentation but many cases it's difficult for you guys to see how that technology actually unfolds in a real living application so by talking about an application allows us to show you essentially technology in action the technology actually doing what its intended to do and add value to you know what a user would be doing at using software and then another point is there's a tremendous opportunity in the technology portfolio that's part of Mac OS 10 for different technologies to synergize for example you'll see in keynote during the course of the presentation how the type system and for example courts to d there are 2d drawing API go together to really create incredible typography or how courts and OpenGL can play together for interesting transition and just great looking application content and I think the key thing that we wanted to do is to help using an application as an example to articulate the possibilities that are behind every technology that's available in Mac OS 10 because we've really sort of reset the technology button when we move to Mac OS 10 because we brought together a lot of brand new technologies that aren't familiar to a lot of the developer community and in many cases you have your existing code basements tough tree to see what the horizons of technologies offer you and your users so why don't we want to talk about keynote and I think the main reason we want to do this is because keynote is is very platform compelling it's an application that uses a lot of technologies and the same time it's it's really simple it's really powerful and it's kind of like Mac os10 marcos tim has got the power of UNIX at the core it's also got a very simple expression in terms of the Aqua user interface and that combination is fantastic one of the reasons keynote is really able to do this is because keynote uses the core technology that's built into the operating system so the keynote team was able to really sort of think about how do they make great app how do they make a great app that adds value to what the user is attempting to do with it rather than have to worry about architect and graphics engines architecting 3d transition effects you know using their own engine and that's a very important point as moving forward as you guys really engage the platform and develop your own sort of platform compelling back those 10 applications is where is where does the engineering that Apple does every year that we improve the operating system you know what advantage does that give you in terms of if you adopt that technology you know what can you do somewhere else inside your application to add value to user experience because you don't have to worry about the drudgery and venting your own technology portfolio and then you know when the key points is a lot of the technologies that keynote uses are very important technologies for Apple there's things like cocoa courts to dr new 2d drawing api QuickTime our multimedia architecture and obviously we spend a lot of time talking about OpenGL and how that's a gateway to accessing the power of the GPU and then also we're going to talk a little bit about XML XML as a way to you know contain document information and then I think the key point is these applications are these these technologies are available for you to use well and then one of the other things we wanted to do is essentially enable you to learn a little bit from the development cycle of an application that's being brought up with all these new Mac os10 specific technologies and part of what the keynote presentation is going to communicate in addition to which technologies are adopted where in keynote is actually provide areas where hey the technology wasn't a perfect fit and we had to do some working around we had to do some something special to make it work for application because many of those cases are you know significant for use developers as well as you adopt those technologies so it's my pleasure to invite Brad Vaughn the keynote engineering manager to stage he's going to take you through you know the presentation thank you thanks Travis Brad Vaughn can you manage the keynote engineering team and we'll do a quick demo of the application in case you're not familiar with actually get a show who's used the app and I know you've all seen it because you're WWDC or looking at keynote all day right but first i want to emphasize the two things that Travis kind of touched on that I want to but I want to kind of makes teams for my for my talk here today those are the things that make keynote great are the technologies that are available in OS 10 we'll talk about those in depth and and the second point is that in some cases the high level API is maybe the out-of-the-box functionality isn't exactly what you need I'll show you in fact some cases i'll show you code that explain how we worked around those issues how we extended the available frameworks etc so let's take a look at the app so the first thing this is keynote first thing you see is what we call the theme chooser you have out of the box 12 beautifully designed themes are created by Apple designers each of which contain nicely coordinated background graphics fonts colors shadows etc so let's create a new document with this leather book theme for example create the document the first thing you see is on our main window it's very simple you know this is aqua this is standard UI controls that everybody is used to something that's easy for users to get into and quickly manipulate their own documents over here we have what's called our slide navigator so i can easily kind of move around my slides organize my slide show like this it's very simple got other views we can you know edit outline give you got kind of an a text oriented presentation but let's take a look at this one I can change masters let me show you some feature we call alignment guides so this is a bad example let me show you here so you can see our alignment guides a little better and you notice these little yellow line snap these are actually static alignment guides when I create new objects on my slide I get dynamic alignment guide so I can easily manipulate my graphics going to get a new alignment guide so I can Center these guys if you do a lot of kind of graphically rich presentations this is very nice a couple other features make another blank make a new slide and show you our chart so charts and tables are built into the application ought to go out to a you know an external utility or in other apps that create a chart so I just click my chart button there I've got a date editor and go in and now out of my data live updates my histogram so it's kind of a plot the growth control of my chart I can you know move my legend around resize etc over here is my chart inspector so it gets kind of more fine-grained control and I can pick from several varieties of chart here's a pie chart as you see you know the contents of trade want to create text i create a chart or create table it's all nicely integrated with the the template that's the style that I've chosen which in this case is leather book so it's really it's kind of hard to make a presentation that that's ugly you have to do some work so yeah so good you know a lot of control over how I manipulate my chart there so let's take a look at another feature table it's as easy as clicking the table button over here automatically switch to my table inspector oh let's make a table of two rows and i'll put some content in there with simon i can't have all caps the try a few shapes in there this will invariably be in the wrong column but I'll put it in there researches microscope ya missed what ok as I I can resize my column very fast the graphics smoothly scale text wraps and let's do a little build so as I do my actual presentation as I'm showing the slides I can build the content onto the slide and we've got several options for that so I'll pick my table and for instance I this is my bills inspector I can pick for instance a flip a flip build we call it that would here's my little preview this this would build the entire table all at once I can also deliver it say by row or by comp so let's take a look at what it looks like if I build this guy on by column one two three columns very smooth finally well let me show you next to last our export formats we support QuickTime export so you can generate a QuickTime movie that contains all the transitions 3d build cetera ship it off to a user on another platform and they can share it we also support PowerPoint export and PDF so let me show you finally a sampling of some of our 3d transitions this is a simple kind of fade transition a push a move these are all this is a set of 2d transitions that we provide out-of-the-box wipe transition and a pivot finally a drops you drop one flight over the other getting to the 3d transitions that's called twirl this is a large mosaic and most of these transitions you can control no there's all of the transitions you can control their speeds several you can control their direction perhaps they come from the center from they move out or in there's a slip of 3d flip horizontal 3d flip and finally the cube everybody's favorite so that's keynote so we want to talk about the technologies the things that make keynotes great first we'll talk about application frameworks keynote built on cocoa talk about why we think Coco is a great basis for your applications one thing's Coco provides a very simple high-level access to the text to the text technologies to make go attend great things you get from Atsui courts etc we'll talk about courts you know keynote really excels at creating graphically rich presentations and we get all that power from courts show you some code that we use to manage images in courts obviously OpenGL the examples that just shows you great 2d and 3d effects that we use OpenGL we'll talk about some of the Kip support for OpenGL as well rich media support that you get from quicktime and you know and it's not just about playing movies on slides in quicktime we also use quicktime to generate a QuickTime compatible output finally we use XML as our file format really excited about that there's been some community support for our format and I'll talk about the operating system support that's there for XML so first application frameworks when we chose when we you know we sat down to decide how we're going to start keynote the main thing we want to do is kind of emphasize the power that's in OS 10 the graphical the power behind the graphical technologies that are in there like opengl quicktime accords so we wanted first class integration with those technologies with this framework we choose a high level frame we're going to be able to get the maximum out of each of these technologies we want to be able to grab powerful components from the kit okay so we want to be able to you know use a lot of these things on the box not to reinvent the wheel for things like UI components etc but we want the components to be flexible and extendable enough so we can you know tweak their tweak the parameters trick tweak a few things get the look and feel the capabilities we want without having to extend everything but we want to be able to extend it and override certain behaviors if we want to we want great performance we don't want layers and layers of software between us and you know the application and the core components the core technology to no end that we want to use for instance opengl we want to make sure we have very fast access to opengl and ease of development you know we started keynote started with a small team limited amount of time as I'm sure you know developers in the audience are familiar with so it's important to have the best tools the best frameworks available to get our app to market and for us Coco was a great choice Coco contains high level access to again the graphics capabilities of graphic technologies that come with those ten quarts OpenGL and QuickTime with Coco you get the standard flexible UI controls that everybody's used to in the OS an operating system the Aqua user interface and as aqua progresses of you know new releases of Coco come out we're kind of reaping the benefits of those if you saw the Scott Forstall talk yesterday the tab view is improving the switch view is improving so we're going to get those benefits NS image with Coco gives you access to not only you know native formats that ms image can decode and display but also compatibility with everything the QuickTime can do all the image formats in QuickTime can display complex use like NS OpenGL view as you saw in my little build inspector was getting a little preview that's an NS OpenGL view for rendering OpenGL content right within a Coco application and this movie view for the same thing with quick times rich media and a window one thing you get with Coco the NS document architecture this is something that makes it easy to provide to your users the kind of features that they expect from a modern application right like undo multiple documents Center running apps multiple windows / document Coco provides macros and classes that make it very easy to localize your app provide your app for multiple languages and with Coco you're using mock oh you've got great compatibility with the runtime throughout the system and you've got NS bundle the ability to load running code executable code and resources into your app in in keynote all our transitions all our bills are 3d builds are I think our exporters and our inspectors are all loadable bundles so in theory people can load new ones in freeze of development we love Objective C Objective C and object-oriented language very very powerful dynamic runtime but it's simple enough you can take you know it's kind of it's got a kind of a small surface area of specific features that are in the in the language so you take a Java programmer in assisi programmer it's a very small learning curve to bring them up to speed on objective c and this is project builder should just a tool right because it's not just project builder now it's xcode looking forward to using xcode quite a bit project builder a full-featured integrated development environment with features like indexed code syntax coloring documentation built-in source code management integration and the other tools like you know Malik debug sampler things that lets you ship a high-quality application so why we chose Coco first class integration with the graphical technologies that we really wanted to highlight no f10 really was going to make keynote a great application powerful components things you can grab use out of the box they're flexible enough that you can know tweak them to your desires and extendable enough that you can tweak them even further that's the breed tools like project builder and now Xcode so let's talk about specific features that cocoa provides like cocoa text well with OS 10 you really get capabilities from several layers of the operating system in courts you know anti-alias text something we've all come to expect now absolutely Apple type system for Unicode imaging provides unicode multiple input handlers styled text and the typographic features that I'll display in a minute here and what you get from cocoa is just some of the application level features like undo key bindings you have things we don't use so much in keynote like formatted text input so let's look very quickly at some of the text capabilities and you know I'm starting with a blank slide because you know click create a new text object bring up the font panel you've got access to all the fonts available in system truetype postscript etc I don't have much slider so I'm not showing exactly how smoothly it can resize but you know Santa Elias razor sharp looks great we go to my text inspector here in keynote save control over simple things like alignment color I also can manipulate the character spacing this is all built into cocoa nothing no code required here and you have fine control over character spacing within a certain range of text and designers love this capability so if I go my next slide I've got some multi-line text I can control the line spacing negative line spacing and talk about ligatures so this is a example of a ligature here's like which is just an elegant way of combining characters it's built into these fonts this is the Zap fino font so T and H are actually one glyph one character glyph when i type th it combines it but you can also manipulate those ligatures and this is built into cocoa so if i turn off the ligature on that combination changes the look as I said this is effing I want to show you something that's just kind of cool VA in jepty know the words up you know is one lick sure looks very hot of course I turned it off I think it would look so little boy this is all in cocoa this is all free so again advanced features with cocoa text kerning character spacing unicode character sets so I've got some kanji here in the really nice hitachino font ligatures there was one Cape 11 feature we needed in keen on you've essentially already seen it that wasn't supported in Cocoa text and that's this kind of cascaded stylesheet ok we wanted to be able to let the user pick a theme pick us pick a master slide and it's got a certain design they get those design attributes they make a change then they may pick another theme we want to preserve the style changes that the user may let me show you how that would work so user creates a new show and they use the white theme type a little text make an attribute change so they've gone from plain text too bold finish their presentation well White's just not quite flashy enough for me let's go to the crayon theme what we've done is we've sure we've at we've changed the background without of some graphics also change the font of their text add a little shadow in this case but we preserve the attribute changes that the user mates we've still got bolded text and last word another capability this gives the user is they can kind of revert all all additional changes all overrides that they've made can be reverted out we'll just go back to the standard style sheet so continuing from the last example here we are on the crayon theme the user goes to menu and says reapply master to selection and the overrides go away we want to go back to the standard master or cascaded style sheet set of attributes cocoa text doesn't really support this and here's a kind of simplified diagram of the architecture of the end of the cocoa texas and we have enough tech vs which you type in controls undo and key bindings and all that stuff and as text container controls where the text is drawn layout manager manages putting the glyphs in different positions and tech NS text storage is your data store behind your text this is the set of attributed runs of text that the user sees now when a user types in to NS text view or they they take the menu and they say bold what happens is the text view tells the nsx storage set attributes in range so in that case where the user made bold they would say you know the weight is bold the range is character 7 through 15 or whatever it would be that wasn't going to quite do it for us that's a flattened set of attributes we needed to be able to say you know which attributes existed on after which ones were created by the user so how we did this we extended the NS text storage by creating a subclass and astec storage is called a semi concrete class when you make a subclass event Aztec storage you're expected to provide your own data storage in this case it's on the bottom the attributed string which is just an ounce mutable attributed string that contains all the attributes that the user sees both inherited from the style sheet and added by the user what we also added was this master attributes dictionary this is the set of attributes that existed in the dictionary when the user created this text so it would be the last example you know the gill sans font with that size-14 or something when you create a subclass of enough text storage again it's a semi concrete class you have to provide the data storage you have to override certain methods here's this is a list of methods you have to override string returns just a plain string with no attributes attributed index effective range tells me you know that at index for I've got or an index seven and last example I've got ten characters of text that are bold replace characters and range is what happens when the user types or kaisa texas paste it in set attributes and range again which I actually covered last time was on the last slide was just applying attributes to a range of characters now what we added in our subclass we have an initializer that just takes the set of styles that exist on the master slide we have a method that returns weather and overriding this excuse me so that is used for menu menu enabling or menu validation does this menu need to be turned on is there an override can the r user revert this this this drink reapply master attributes which is what happens when the user clicks that menu that's basically where thats implement it is we take the dictionary that exists we apply it to the entire range of the string set master attributes is kind of the money method here what this guy does is he looks at the existing set of master attributes in the string compares them to the new set so this is this guy's called when so master attributes is called when the user changes the master slider changes the cascaded stylesheet so we say for each run of text reach effective range of styled text does and attribute exists in the old master if so let's let's replace it with the attributes in the new master that preserves the stuff that's been changed the stuff that didn't exist in the old master attributes list so Coco text you have a great set of features typography Unicode text out of the box it just works with cocoa and the setups kind of application level undo and key bindings middle no op minimal amount of coding to get at those features and they're all supported in the UI you know the standard menus for cut paste manage kerning ligatures fonts etc just work out of the box but as we all know after watching some of these slides great presentations are not built on text alone all the graphical features you get in keynote comes from quartz 2d very quick overview of what you get with quartz 2d path based drawing vector-based drawing so we draw our shapes with paths and they resize perfectly and all that control of stroke and dash settings good maps image rendering it's based on PDF you can actually have control over drawing PDF documents or sections of PDF documents or PDF clipart within your application transformed I didn't know i'll show you in the demo but rotation translation scaling shearing etc and transparency awesome alpha blending so again I'll show let's take a look there's the blank slate I'll just throw a couple shapes on and these guys come on with an image Phil let me look at my graphics inspector I can change to say a gradient fill is supported by courts I can you know change my colors change the angle make it so I opaque it's very fast out of stroke various dash styles and affect opacity here change the order and here's some images so image is very high quality but they rotate very fast change opacity and performance is fantastic ok so again chords features path face drawing PDF drawing we've gotten a shape with a standard color and stroke in an image where now I've added a gradient fill and a shadow the thing is I mention about shadows so what we wanted in keynote was shadows that are a lot like what you get from the menu in OS 10 for the windows and didn't really have that we had to actually add some code to do that the good news is in Panther the shadow api's are available so because hopefully we won't have to do quite as much as we did again back to the features anti-alias text image drawing alpha blending and great performance of courts too deep you have a PDF based image imaging model the same imaging model that sends information to display the drawers what you see is what sent to your printer drivers for raster and post script output color sync color syncing both to the display into your output device and on compatible hardware quartz extreme for GPU accelerated window compositing now what do we need in keynote we didn't get from quartz we wanted professional quality image manipulation as you may know if you heard the keynote at Macworld San Francisco it was designed for Steve Jobs and he's using these very very high quality images multi megabyte and you can't we can't sit around and wait while we're rotating and resizing these images so manipulation has to be fast but we also have to quickly move its you know the presentation that we have to quickly go back and forth through slides well with cocoa and start with quartz high-quality resize is built in so here's an example how you do it in in cocoa you just grab a graphics context and set high image and triple set and s image interpolation high and quartz goes off and does you know kind of more complicated scaling if you're not using cocoa you can still do this in core graphics to grab the graphic support use a different flag it's available now talking about image manipulation when the user rotates or moves and image around we want to be able to we went we want the interaction to be very very fast so what we do is we cache a smaller representation of that image you know so if the user is using a 50 megabyte tiff file will actually save a smaller version if the users resizing for instance now this is a kind of abbreviated UML that our image view is what the user actually sees and manipulates on what we call the slide canvas the image model in this in this instance the the instance variable is called my image that's come to canonical image that the user brought in from the finder or they they pasted so we're keeping track of the original image but in many cases and I'll show you where we create this guy we have a cached image that we use to render instead miss much faster so on our canvas the user Mouse's down we determine whether an image was selected and tell it to dynamically resize it's in that method when the image view is told to dynamically resize it determines whether the model has changed enough that it's actually worth doing we say if this image is you know say in this case ninety percent scales then we'll create a cash game we just make a copy sock it away subsequent on subsequent renders we'll just render the cached image and this actually makes a big difference in interaction performance another challenge so when creating multi-page PDF as you see in this example all these slides use I think with the exception of the first one they all use the same background image the last to use the same you know piece of clipart this calendar the the one and eight or actually text so it looks pretty good the the charts in this example use an image fill so it's kind of a repeating image when we generate pdfs we want to make sure that you know we're not sending this these images out to PDF to our PDF stream multiple times how do we do that well PDF supports this optimization you write the image once and use this X object reference and PDFs will go back and read it out of the original stream GG image ref supports the capability let me show you how we create BCG images again back to our uml model the image model contains the original NS image we've been stanch at it from the finder or pulled it off the clipboard or whatever we also keep track of a CD image up uses the same data as long as we use that CD image rep to render will get this optimization our PDF output so to create a CG image dress you have to create a CG data provider so you can create it if you've got enough image if you have an in a bitmap image rep which image rep in this example is image rep is an NS bitmap image up we just pull the bitmap data out tell the data provider what the depth is and how big the images create that provider hand that off to cg image create cgm is great again you tell it how big the image is going to be how big you want to suck actually how big you want to render it the depth a couple other flags that control you know the color spaces just kind of the default flags here what the alpha value is and when you want to draw BCG image the CD image if a variable that I've got here which is a CG image ref to draw that you just draw up to the graphic support the current graphics context and tell it how big you want to draw as long as you draw that to your PDF output context you're going to get this optimized output so summarize quartz bridge to d capabilities path based drawing PDF model all available to you layered api's if it turns out you're using cocoa or whatever java and the API 0 aren't available you've always got core graphics which is the courts kind of standard layer for it of api's and phenomenal performance with a quartz extreme now that's a 3d that was one of our 3d transitions you know we all be editing on a keynote slide canvases courts but how do we get this core graphics these courts objects up to the screen in OpenGL so we can do these kind of cinematic effects so there's there's again the 3d effect we've also got the 2d effects so there's a drop and we can not only apply these effects to a slide transition from one side to another but I've also objects that are going on to the slide so there's a 3d text build a little slip we can also build objects off the slide so here's a scale as you saw when I was creating my my builds earlier I got a little preview in my inspector so this is an NS OpenGL view it's available in cocoa basically drop this view onto your cocoa into your cocoa application and off you go you're your programming OpenGL actually a really good way to get started with OpenGL programming so in this case what the user sees in this preview is exactly what they're going to get when they go to full screen mode how do we get the courts 2d images and text and all that path space shapes into OpenGL wees this abstraction it's in the center here called a textured rectangle so I'll walk you through how we go from something like an NF simich we grab data from the image apply GL operations to it as a textured rectangles look at the codes of that the interface of this textured rectangle it's not just one kind of blob that we're manipulating an OpenGL we actually in order to get the kind of maximum maximum compatibility with hardware that's available you in some cases you want to chop your textures up on power to boundaries so what we this textured rectangle kind of abstracts the fact that there are these disarray of smaller textures that we may have created and we also track the target the thing that we're going to actually render the textures to the way you initialize this guy you in this case there are several you know it's much bigger ap oddness obviously you can create it with a bitmap and when you want to draw there's an API for drawing all four corners if you're if you're modelview matrix isn't transformed you actually just want to specify exactly where the texture is going to draw with opacity now in a bitmap image rep the data is actually rgba you know opengl will render this stuff but the most efficient way to do it is using a RGB so this is just a very simple method that swaps the high order and low order bytes and very fast and now in with a RGB we've got kind of the highest performance Malaysian of the textures on the graphics card and we want to draw the image this first page here shows how we turn on the opacity support so we hand off the GL blend method to GL enable paths and flags of the GL blend function and we apply the opacity using GL color for F there's a i'm not actually not the OpenGL expert but there's a there's a session on OpenGL optimization where they kind of address why that's important that the image is pre multiplied in order to render the textures as I said we've got this you know abstraction that hides the fact that this thing's been chopped up into several textures on power two boundaries so we walk through the texture array and blit it all out GL text cord to to DF and GL vertex to us to draw at the corners based on the offsets from the original texture so we chopped it up and we're keeping track of where the offsets are turn off opacity was disabling blending and release the target so opengl you know we're not just using opengl to do you know moving to do to do our flips we're actually you know the GPU is available we found a good way to use it to accelerate to d effects and accelerate course to the output with cocoa you have these high-level abilities like opengl view to do to do previews to get started with opengl and there's several level levels of api is available with opengl that are all there in OS 10 glute cgl we use in keynote to manage the display and GL for the lower level operations so the last graphical technology will talk about its quick time and I've got a little demo here this is a a movie that's set to loop and I've applied a 50-percent transparency I think to this guy and I'll build a few additional movies on every to these movies comes on they've got their set to a certain poster frame this is the the frame we want to display when you first see the object on the slide I think you can see you know you've got excellent frame rate while the builds are happening and the so pacity and this is really you know the power of quartz extreme kind of work here so a quick time you've got you know you're really leveraging all the advantages that are there within the system you've got all the image formats and those are available through NS image and Coco all these sound formats all are you know the sounds that we use in Cocoa kind of treat them as movies we just play a sound and obviously full motion video and when I say you're leveraging the power of QuickTime updates the cliq QuickTime come out they supply new file formats they they they support new image formats or or movie formats and that just works you know quicktime 63 came out a few days a few weeks ago suddenly keynote supports exporting 3gpp movies so we can export a 3gpp movie of slides and you know like a little slide show preview on your cell phone the image file types that are available on your system so it's you know dependable codecs and and what version of quicktime are available but you can ask NS image what image file types your supporters returns a list of file extensions and HSS file types so again the image formats are available integrated into NFS image and co co NS movie view you can use to preview a movie and control the playback and speed and scrub through it flex and a very flexible extremely flexible core API for not only you know showing movies grabbing content from from your from your media but also export QuickTime movies so when you use NS 0 NS movie gives kind of just a simple look at how you can use NS movie view to actually build some kind of a small simple version of quicktime the API Zener just start to start the motion set the rate if you want to fast forward or reverse through the movie you can control volume and mute the movie what we wanted in keynote is I pointed out these movies I was building on they're all set to a certain poster frame so in this example the the inspector the top slider controls the poster frame that the user wants to see when the movie comes on so you kind of move this guy back and forth and you're scrubbing through the entire movie let me show you how you do that using NS movie view the slider sends an action called take poster frame from the slider the slider value would be a percentage you want to start at zero or go to 100% all the way through the end of the movie we determined you know the floating value you know point five would be halfway from the slider determine the time offset within the movie that that corresponds to that percentage corresponds to and then set it on this subclass of NS movie that you'd create you say set poster time to that offset till tell the movie to display that offset obviously as the user scrub through so i do believe i missed a slight the implementation of those methods oh yeah actually i didn't miss the slide within the implementation of steps poster time you would use quicktime api set movie poster time which takes a QuickTime movie and a time value to set the poster frame so that's a case where you're you know kind of mixing the high level API for NS movie view and the lower level API is a QuickTime so summarize quick times phenomenal compatibility with all these image formats move media formats sounds etc coco integration within us movie view and NS image support the image image formats and a rich comprehensive set of AP is to control media playback and export finally XML we love XML it's really created kind of a community already around keynote there are applications available that manipulate and use the pokeno 4matic we think XML is a great way to encourage innovation get other parties involved in supporting your app encouraging use of your application and one of the things it's not that obvious is it it's really good for development you can validate a set of documents that you generate you can generate these documents before your apps complete you know you've got your data model you've got your XML schema or document type definition ready generate a set of documents your app ought to be able to handle very simple way to do some testing validate the output make sure that your archiving you're on archiving code is actually generating documents that conform to the standard that you've specified for your XML what do you know as ten core foundation has several layers of XML support if you're just using NF coder NS coder not familiar is kind of the standard way of serializing objects in cocoa and you can tell NS coder to use an XML format the standard formats binary you pass transcoder this flag its property this XML format then the output will be XML and that property list format is defined on the on the on the on some websites um I think it's on ADC some place you have within core foundation a high-level parser which you just handed a document or a stream of stream of XML text it hands back to the structure called the CF XML trees so you can then walk through elements data and attributes for each node construct your data model that way or just maybe manipulate search for data etc there's also a low-level parser was kind of a sax type parser elements are encountered of attributes are encountered you can define callbacks so the your code is called into then you're going to create your data model that way well for kino we use the low-level parser you know the we encounter a slide and we go off and create a slide but when we generate xml we actually just use immutable strength we just generate this NS mutable string on the fly and this is kind of the the class that we to do that it's called a dom writer a document object model writer so you start an element you say here's what I want to start something with that the slide or a bullet point end it right attributes like what color it uses control formatting with indented could increase in decrease in death and you can also pass in the structure of this this XML element similar to CF XML element to create to write an actual subtree all the way out to the string so our file format is open the scheme is available at techno 2067 there's already third-party developer support their file maker has an application that generates and a library code that generates keynote documents for D has the same thing we think there are a lot of possible applications you can obviously pull data off the web pull data from your enterprise data store generate kiosks presentations with great you know 3d transitions migrate your legacy data into our tables or build I'm sorry I tables or charts and here's them I'm going to actually give you a demo of the 40 presentation builder what this does is it auu the user interacts with this the few I to create a query it generates the XML and the output of the presentation I'll show it to you so here's the UI they've set up this kind of sample database of properties you know they've got this I think they include the club they include the code to generate these are format but this is just a sample database of for instance real estate properties user can go pick a buyer so the idea is I'm a real estate agent i'm going to edit properties of this sir and it attributes that aspire what they want to spend where they want to live and then create a new presentation so it tells me i'm going to show you all the properties in this price range at this at this price in the zip code and i want to open the new presentation so the documents created keynote opens i'll just play it so now I'm a real estate agent I've got this very simple simply created little kiosks that I can show my my client has been sitting there with me for three minutes they get the idea yeah the slides please thanks so xml great for building a community around your application it's really great for development you know validate your documents generate your documents before your apps even ready to generate your documents and they're supporting in core foundations for several levels of XML usage so keynote as we develop the app we found the Coco was the best framework for us we made great use of the cocoa text capabilities to make it very simple to get us the the very powerful technology that's available we use quartz for creating beautiful graphically rich applications or presentations opengl for 3d cinema cinematic effects as well as to the effects quicktime we generate QuickTime movies we display QuickTime movies we have great control over the QuickTime movies that are in the presentation an XML again an open file formats that you can really build support around so what can you get out of this now all these technologies are available the modern operating system make use of the technologies if one way of getting at the feature set you want doesn't work there's probably another right set of AP is and they're all extensible first-rate tools available on the operating system take the people you've gotten your organization I look forward to seeing your app thanks a lot [Applause] so what I'd like to do is just go through the roadmap of the remaining graphs Imogen related sessions starting two morrow morning and Wednesday in the marina we have image capture update what we're going to do is talk about the api's they're available in the system that handle both digital cameras and also scanners so if your applications need to import or bring graphics in from the real world into the virtual world and tighter computer this is the architecture and the api's are going to want to know about later in the day on Wednesday we have vertex programming with OpenGL a big theme for graphics and imaging this year this track this year at Apple is leveraging the GPU to do exciting things and with vertex programming we're going to talk about essentially how to use the GPUs ability to transform geometry to do interesting geometrical transformations because there's a you know a lot of interesting effects and complex geometry that you can generate using the GPU then we're going to go into a color sync update and we're going to talk about a lot of the new developments in color sync and again this year as evidenced by information and the key code the QuickTime session this morning the sort of QuickTime overview where there's been actually a behavior change inside the system with regard to color management obviously in the newer API is inside the system we've been building color management automatically into the platform so for example courts to d also cocoa or very color management aware but a lot of applications that leverage you know carbon apps that leverage like QuickTime image image importers were not handling profiles correctly so we're continuing to build out the support for color sync by making now QuickTime more color sync aware and this session we'll talk about that amongst other things relating to color management we have a session they'll talk about quartz 2d and depth if you liked what you saw in this presentation with regard to the graphic capabilities of keynote and you for example are using may be quick trois or key API in your application this is number 207 on Thursday in the morning it's going to be where you want to go to learn about chords 2d then we're going to have a very interesting session which is too late it's sort of the cim onion session to vertex programming and this is fragment programming and this is doing / essentially per pixel operations filters if you will on using the GPU and this is a very very interesting session I have to say this is probably my favorite session of the grant and imaging track just because the capability of doing per pixel operations on the GP is still unlimited right now and now the advent of programmable hardware it's sort of a really interesting time in computer graphics so that's going to be thursday at 1030am then another key session if you're an OpenGL application and you want to learn how to optimize your application or your beginning opengl programmer and you want to learn how to do the right things the first time you want to come to 29 opengl optimizations and this is really going to focus on running a lot of information about the fast path so that we put into mac OS x opengl because it's interesting our opengl stack is optimized and tuned in certain ways that once you put your application on those fast path you're going to get unbelievable performance so that's 29 on thursday is going to go over that and then we have to 10 mac OS 10 printing update and it's going to talk about a lot of the new developments and mac OS 10 printing we're actually going to talk about one exciting one which is the ability for the system to convert postscript into PDF now which is a new Panther feature and that has significant ramifications for people and printing and imaging so it's an excellent session to attend then we have to 11 which is introduction to court services this is our first session on Friday and this session is going to talk about essentially the parts of the courts architecture which do not actually draw anything these are the parts that control and manage displays so this is an important session if you have a full screen application or you have an application that needs to find out what the display environment is because there's a lot of api's of developers and had trouble finding and understanding how to use it we're going to talk about in this session and then we have on to 12 hour hardware partners API coming this year to talk about essentially the latest techniques you can do to do the interesting visual effects using programmability and and their product that radeon 9700 so that's a session 2 12 cutting-edge opengl techniques we have a partially related session if you're an application developer you might want to check out the mac and accessibility session where we're going to be talking about how to make your applications accessible the users with disabilities it's important session for for anyone who develops an application to attend because there's a large audience out there who through simple changes in your application you may be able to reach new customers who happen to have a disability then finally we have our the main opportunity for you guys to give us your feedback and let us know what you thought of the sessions what you like what do you want to see inside the ls essentially you know let us know what we need to do to continue to involve Mac os10 is the most innovative and graphically powerful operating system on the planet and that's the feedback forum which is in our traditional slot friday at 5pm so thank you very much for attending the session appreciate it [Applause] you
