eudora-mac/Include/mywindow.h

1 line
22 KiB
C
Raw Permalink Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef MYWINDOW_H #define MYWINDOW_H /* Copyright (c) 1990-1992 by the University of Illinois Board of Trustees */ /********************************************************************** * my own window package **********************************************************************/ // // (jp) Under Carbon you can't use extended Toolbox data structures because everything stored within // a WindowRecord, DialogRecord, ControlRecord, etc is supposedly stored in some sort of vague // amorphous we'll-move-things-around-if-we-feel-like-it fashion. // // We have a couple of options here: // 1. Store a WindowPtr in our MyWindowStruct, then continue to pass around pointers to our // own window structures. // 2. Pass around WindowPtr's and store a reference to our MyWindowStruct in the refcon field. // This would also necessitate that we move the current contents of the refcon field into // a refcon field within MyWindowStruct. // 3. Use Window properties. // // Okay, of these three choices, number (3) is clearly the most Apple-sanctioned way to do this. // It's also likely the most un-backwards compatible way to deal with our source code. Plus... // after my experiences using Control properties while implementing Nav Services, I don't trust // properties, no matter how cool they are supposed to be. // // With (3) out of the picture, let's look at number (1)... Number (1) is probably the method that // requires the least amount of change to the existing code base -- but (2) is the bestest and // purest "object model". (2), however, is going to be a pain since we'd have to make fairly // significant changes throughout the code. (1) is a pain too, since we'd have to do backflips to // access back to our own window structure if all we have is a WindowPtr. // // For now... let's do both (double the pain and twice the fun!) // // MyWindowStruct // ________________________ // | | // | | // | | // |------------------------| MessType (or whatever) // | Ptr to normal | ________________________ // | refcon stuff ---------------------------------------------> | | // |------------------------|