gecko-dev/embedding/browser/powerplant/ReadMe-Carbon

128 строки
4.3 KiB
Plaintext
Исходник Ответственный История

/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Conrad Carlen <ccarlen@netscape.com>
*/
Build Environment
-----------------
The Carbon targets for PPEmbed are built using PowerPlant 2.2.
Copy this into the "Carbon Support" directory which is used by
the Fizzilla build. It's name should still be "PowerPlant"
Incompatibilities
-----------------
Our Fizzilla build environment currently uses CW 5.3, Universal Interfaces
version 0x0341, and PowerPlant 2.2. Using the 5.3 compiler causes
problems for the compilation of PowerPlant 2.2. Modification
needs to be made to PowerPlant in order for this to work:
1. UReanimator.h - This file uses an non-inlined template member
function. This feature is not supported by the 5.3 compiler. Move
the implementation of UReanimator::ReanimateObjects back inline
and it will compile.
Diffs are included. Though maybe more trouble than it's worth, you can
use the patch utility under OS X to apply the diffs (if the line endings
are Unix-style). The modified versions of these files can be placed in:
mozilla/lib/mac/powerplant/overrides/ so that you don't need to modify
the originals. This directory is in the project search paths.
--- developer/fizzilla tools/metrowerks codewarrior/carbon support/powerplant/utility classes/ureanimator.h Thu Jul 12 10:52:43 2001
+++ users/conrad/development/seamonkey/moz/mozilla/lib/mac/powerplant/overrides/ureanimator.h Thu Jul 12 10:53:18 2001
@@ -24,10 +24,35 @@
class UReanimator {
public:
+ // -----------------------------------------------------------------------
+ // <09> ReanimateObjects Template Member Function
+ // -----------------------------------------------------------------------
+ // Type-safe wrapper for creating objects from resource data
+ //
+ // Returns nil if there is a failure in creating *any* object
+ //
+ // For "T", specify the type of the first object, usually the top-level
+ // object in a hierarchy. For example, to create a LWindow:
+ //
+ // LWindow* theWindow = UReanimator::ReanimateObjects<LWindow>(
+ // ResType_PPob,
+ // kMyWindowID );
+
template <class T>
static T* ReanimateObjects(
OSType inResType,
- ResIDT inResID);
+ ResIDT inResID)
+ {
+ T* theObject = static_cast<T*>( ReadObjects(inResType, inResID) );
+
+ if (sConstructionFailed) { // Construction failed for some object
+ delete theObject; // Delete partial object hierarchy
+ theObject = nil;
+ }
+
+ return theObject;
+ }
+
static void* ReadObjects(
OSType inResType,
@@ -54,36 +79,6 @@
private:
static bool sConstructionFailed;
};
-
-
-// ---------------------------------------------------------------------------
-// <09> ReanimateObjects Template Member Function
-// ---------------------------------------------------------------------------
-// Type-safe wrapper for creating objects from resource data
-//
-// Returns nil if there is a failure in creating *any* object
-//
-// For "T", specify the type of the first object, usually the top-level
-// object in a hierarchy. For example, to create a LWindow:
-//
-// LWindow* theWindow = UReanimator::ReanimateObjects<LWindow>(
-// ResType_PPob,
-// kMyWindowID );
-
-template <class T> T*
-UReanimator::ReanimateObjects(
- OSType inResType,
- ResIDT inResID)
-{
- T* theObject = static_cast<T*>( ReadObjects(inResType, inResID) );
-
- if (sConstructionFailed) { // Construction failed for some object
- delete theObject; // Delete partial object hierarchy
- theObject = nil;
- }
-
- return theObject;
-}
PP_End_Namespace_PowerPlant