<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>TeXShop</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <style type="text/css" media="screen">@import "v1.css";</style>
</head>

<body>

<!-- title and menu -->
<div id="header">
  <ul>
  <li class="titel"><img alt="Logo" src="logo_klein.png" />TeXShop</li>
  <li><a href="index.html">About</a></li>
  <li><a href="tahoe.html">Tahoe</a></li>
     <li><a href="obtaining.html">Obtaining</a></li>
    <li><a href="installing.html">Installing</a></li>
     <li id="current"><a href="history.html">History</a></li>
    <li><a href="extras.html">Extras</a></li>
    <li><a href="links.html">Links</a></li>
  </ul>
</div>

<!-- gutter with download links -->
<div id="subheader">
<center> [ Direct Download: <a href="texshop-64/texshop.zip">Latest TeXShop</a> | <a href="texshop-64//texshopsource.zip">Latest TeXShop Source</a> ] [ <a href="mailto:koch@uoregon.edu">Contact</a> ] </center> 
</div>

<!-- links on the left -->
<div id="menulinks">
<ul>
<li><a href="history.html">History</a></li>
<li><a href="collaborators.html">Collaborators</a></li>
<li><a href="intel-arm.html">Intel and Arm</a></li>
<li><a href="arc.html">ARC</a></li>
<li><a href="64bits.html">64 Bits</a></li>
<li id="mcurrent"><a href="fragilebaseclasses.html">Fragile Base Classes</a></li>
<li><a href="autosave.html">Automatic Saving</a></li>
<!--
<li><a href="texshop-64/texshop.zip">TeXShop 3 for Lion</a></li>
<li><a href="texshop-64/texshopsource.zip">Lion Source</a></li>
-->
</div>

<!-- main content -->
<div id="main">


<h3>The Fragile Base Class Problem</h3>

<p> We call the classes Apple provides in Cocoa the "Base Classes". A Cocoa program subclasses these objects,
and adds additional objects. The following dream is a consequence of this organization: perhaps Apple could add extra features to the base classes in a system update and all programs would inherit these new features for free. It is not uncommon to update macOS and hope that TeXShop runs a little faster.
But if the dream were possible, you would update macOS and TeXShop would get the new features you always wanted without any work from me or my collaborators.

<p>Unfortunately,  object oriented languages have two problems which make this dream impossible. First, it is not possible to add new instance variables to the base classes. And second, it is not possible to add new methods or procedures to the base classes. A system update can rewrite the base classes and make them more efficient, but it cannot make them do brand new things.

<p> Now NeXt and Apple used Objective C rather than C++. In Objective C, <i> it is possible to add new methods to base classes </i>. So half of the problem goes away. But it isn't possible to fix the other problem because Objective C has a "runtime component" which is provided by the operating system. Changing that component would break all existing Cocoa programs.

<p>Apple found itself in a highly unusual situation when it added support for 64 bit programs to macOS. For just one moment, there were no existing 64 bit programs. So Apple could provide new runtime code for 64 bit Cocoa applications without breaking anything. Using this unique opportunity, Apple rewrote the runtime specification for 64 bit Cocoa applications and completely fixed the Fragile Base Class Problem in macOS.

<p>Usually Apple is good at supporting much older systems, but for a short time starting with Snow Leopard, they made quite new systems obsolete so only the latest systems could upgrade to Lion and Mountain Lion. A consequence was that almost all applications on these systems were running in 64 bits with the new runtime. For the first time in history, Apple could update base classes and provide new features to existing programs automatically without recompiling anything. This is an astonishing accomplishment, and Macintosh users should celebrate. Instead, most seem unaware of what happened.

<h3>Consequences of the Fix</h3>

<p> Users often requested the following TeXShop behavior. If they quit TeXShop with windows still open, and later restarted the program, they wanted the old source and preview windows to reappear exactly where they were before the program closed. For years I promised to add this feature but never did. Then macOS 10.7 (Lion) appeared, and
suddenly the feature worked in TeXShop although we had done nothing. Apple made it work automatically. Currently it works in TeXShop and everything else provided you select the correct Apple System Preferences configuration.

<p> On the main TeXShop web page, we provide a link which gives the original 2000 version of TeXShop and its source code. We  recompiled the source without changing anything and it worked on Intel. Moreover that original version now has the feature described in the previous paragraph because Cocoa added it automatically.

<p>Another common TeXShop request was tabbed source and preview windows. Instead of dealing with multiple windows, new source files should  open as tabs in one source window, and their associated pdf files should open as tabs in the Preview window. The two tabs should be linked, so typesetting a tabbed source should open the corresponding tabbed preview. Etc. All very complicated, so we avoided the request. But it appeared automatically in Lion, and then in even more powerful form in later systems.

<p> The full implications of these new tabs require several pages to describe fully, and yet Apple's automatic implementation worked with virtually no tweeking from the TeXShop developers.

<p> TeXShop has a "Help" menu, and that menu contains several items including a 200 page manual for TeXShop. The manual describes tabs and how they work cooperatively in a full chapter. Consult that chapter for details.   

<!--
<h4>Beginnings</h4>

The release of TeXShop 3.0 is a good time to think back on the history of TeXShop. In 1996, Apple was in terrible shape; rumors swirled that the board was trying to sell the company, and an attempt to construct a new operating system, Copland, collapsed. In the fall of that year, Apple was in negotiation with Be Inc. to buy their operating system. Then around Christmas time, a new rumor said that Apple would instead use NeXtStep. 
Shortly afterward in rapid fire succession, Apple announced that they had bought NeXt lock, stock, and barrel, that NeXtStep would indeed become OS X, and that Steve Jobs had agreed to become an adviser of the company.

<p>As one of the few owners of a NeXt machine, I celebrated. But Apple wasn't out of the woods. A few months later, the provost of the University of Oregon sent faculty a note saying that because Apple was in such desperate straits, special permission from him would be required to buy a new Macintosh machine. This on a campus with a substantial Macintosh presence. I wrote a bitter reply. 

<p> One of the virtues of the NeXt was that it came with a free TeX system, including a wonderful GUI for TeX called TeXView, written by Tom Rokicki. I began telling our Apple representatives that TeX was important on OS X, and asked them to investigate TeXView. Porting TeXView to OS X became much harder when Apple switched from Display Postscript to  the PDF-based Quartz system. Around this time, I got a chance to attend an Apple Developer Conference; I believe it was WWDC 1999. During that conference, I realized that it might be possible to write that TeX interface myself with Cocoa. After the conference, I began planning, and made the crucial discovery that pdfTeX, which claimed to be version 0.14, was mature and could directly output pdf. That made writing TeXShop a piece of cake.

<p>When the program began working, I released it under the GPL, and immediately attracted collaborators. For a few years, I suspect there were more collaborators than users. You'll find a list of people who worked on TeXShop on this site. Thanks to every one of them.


<h4>The Release of OS X</h4>

Apple's initial support for PDF display was spotty; in beta versions of OS X, the software could not interpret embedded fonts in pdf documents. Therefore, TeXShop could only preview TeX documents which used the Times Roman font and contained no mathematics. Quite a limitation. To get around this, early versions of TeXShop had a preference setting which caused TeXShop to convert pdf pages to bitmaps using Ghostscript, and display these bitmaps in the Preview window. As you can imagine, the output was blurry and just barely useable. But hey, you could write TeX on OS X for free.

<p> I next attended the Apple Developer Conference in 2000. At that conference, Apple was expected to give developers a preliminary copy of
the release version of OS X. I bought a portable just before the conference and partitioned the disk so I could install that copy as soon as possible. In the keynote, Steve Jobs said "sometimes in this business, a name change is needed for marketing reasons even when the strategy is unchanged'' and then he announced that the release version of OS X would instead be called "Mac OS X Public Beta", and would sell for
a stocking fee of $29.95 rather than the usual $129.00. I was sitting next to a friend who was a professional developer in Portland, and after the keynote he said to me "wasn't that slick. He actually announced that OS X is delayed for a year." I took the public beta home that night, installed it on my portable,
ran TeXShop, and discovered that the pdf display system still could not use embedded fonts. 

<p> The real release of Mac OS X occurred on March 24, 2001. Contrary to tradition, Apple gave developers a copy of this system only a week before the release. I installed, ran TeXShop, and discovered that embedded fonts  worked. That was the single most thrilling moment in the life of TeXShop. I spent that week tearing out the "construct bitmap with Ghostscript" code, and finally had a program which worked as planned.

<h4>Collaboators; Exploiting Cocoa</h4>

Although Apple's PDF display code was brand new when OS X was released, the Cocoa development environment in Mac OS X was mature from the start because it had been used at NeXt since 1989. Consequently, a wealth of opportunity existed for the development of TeXShop, and collaborators began exploiting these opportunities soon after Mac OS X was released. Soon TeXShop had toolbars, applescript, a proper Help system, Key Bindings, Command Completion, and a LaTeX panel. Thanks to my collaborators.

<p> Perhaps the single most important contribution came from Mitsuhiro Shishikura, who completely rewrote the pdf display system to support Single Page, Double Page, Multiple Page, and Multiple Double Page display, and to  support Fixed Magnification and Fit To Window Magnification. Shishikura also added the magnifying glass. I'd still in awe of these additions.

<p> During these first years, TeXShop didn't exploit new features in the operating system as further releases occurred because there were already lots of opportunities in Cocoa. 

<p> <p> 
-->
 </div>


</body>
</html>