LCL Carbon: removed FPC version ifdef's

git-svn-id: trunk@16165 -
This commit is contained in:
tombo 2008-08-20 15:14:26 +00:00
parent e958afc294
commit a4c53780ce
36 changed files with 74 additions and 931 deletions

1
.gitattributes vendored
View File

@ -3097,7 +3097,6 @@ lcl/include/wincontrol.inc svneol=native#text/pascal
lcl/inipropstorage.pas svneol=native#text/pascal
lcl/interfacebase.pp svneol=native#text/pascal
lcl/interfaces/LAYOUT.txt svneol=native#text/plain
lcl/interfaces/carbon/FontPanel.pas svneol=native#text/pascal
lcl/interfaces/carbon/README.txt svneol=native#text/plain
lcl/interfaces/carbon/carbonbars.pp svneol=native#text/pascal
lcl/interfaces/carbon/carbonbuttons.pp svneol=native#text/pascal

View File

@ -1,735 +0,0 @@
{
File: CommonPanels/FontPanel.h
Contains: Carbon Font Panel package Interfaces.
Version: CommonPanels-73~983
Copyright: © 2002-2005 by Apple Computer, Inc., all rights reserved
}
{ Pascal Translation: Gale R Paeper, <gpaeper@empirenet.com>, 2006 }
{
Modified for use with Free Pascal
Version 200
Please report any bugs to <gpc@microbizz.nl>
}
{$mode macpas}
{$packenum 1}
{$macro on}
{$inline on}
{$CALLING MWPASCAL}
unit FontPanel;
interface
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
{$setc GAP_INTERFACES_VERSION := $0200}
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
{$endc}
{$ifc defined CPUPOWERPC and defined CPUI386}
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
{$endc}
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
{$endc}
{$ifc not defined __ppc__ and defined CPUPOWERPC}
{$setc __ppc__ := 1}
{$elsec}
{$setc __ppc__ := 0}
{$endc}
{$ifc not defined __i386__ and defined CPUI386}
{$setc __i386__ := 1}
{$elsec}
{$setc __i386__ := 0}
{$endc}
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
{$error Conflicting definitions for __ppc__ and __i386__}
{$endc}
{$ifc defined __ppc__ and __ppc__}
{$setc TARGET_CPU_PPC := TRUE}
{$setc TARGET_CPU_X86 := FALSE}
{$elifc defined __i386__ and __i386__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_X86 := TRUE}
{$elsec}
{$error Neither __ppc__ nor __i386__ is defined.}
{$endc}
{$setc TARGET_CPU_PPC_64 := FALSE}
{$ifc defined FPC_BIG_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
{$elifc defined FPC_LITTLE_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
{$elsec}
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
{$endc}
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
{$setc CALL_NOT_IN_CARBON := FALSE}
{$setc OLDROUTINENAMES := FALSE}
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
{$setc OPAQUE_UPP_TYPES := TRUE}
{$setc OTCARBONAPPLICATION := TRUE}
{$setc OTKERNEL := FALSE}
{$setc PM_USE_SESSION_APIS := TRUE}
{$setc TARGET_API_MAC_CARBON := TRUE}
{$setc TARGET_API_MAC_OS8 := FALSE}
{$setc TARGET_API_MAC_OSX := TRUE}
{$setc TARGET_CARBON := TRUE}
{$setc TARGET_CPU_68K := FALSE}
{$setc TARGET_CPU_MIPS := FALSE}
{$setc TARGET_CPU_SPARC := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_UNIX := FALSE}
{$setc TARGET_OS_WIN32 := FALSE}
{$setc TARGET_RT_MAC_68881 := FALSE}
{$setc TARGET_RT_MAC_CFM := FALSE}
{$setc TARGET_RT_MAC_MACHO := TRUE}
{$setc TYPED_FUNCTION_POINTERS := TRUE}
{$setc TYPE_BOOL := FALSE}
{$setc TYPE_EXTENDED := FALSE}
{$setc TYPE_LONGLONG := TRUE}
uses MacTypes, AEDataModel, AERegistry, ATSTypes, CarbonEventsCore, CFArray, CFBase, CFDictionary, Quickdraw;
{$ALIGN MAC68K}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Font Panel-Related Events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{
* Discussion:
* Event classes
}
const
{
* Events related to font selection or handling.
}
kEventClassFont = $666F6E74 (* 'font' *);
{
* Summary:
* Common command IDs
}
const
{
* The state of the Font Panel should be toggled, displaying it or
* hiding it as necessary. If the user closes the Font Panel directly
* from the window, the application will receive a
* kEventFontPanelClosed event.
}
kHICommandShowHideFontPanel = $73686670 (* 'shfp' *);
{ Font Events }
{
* Summary:
* Font events (kEventClassFont)
*
* Discussion:
* When the user closes the Font Panel, a kEventWindowClosed event
* will be detected by the Carbon event handler installed by the
* system. The system then notifies the application that the Font
* Panel has closed by posting a Carbon Event Manager event. This
* allows the application to update any menu items or other controls
* whose state may have to change because the Font Panel has closed.
* kEventWindowClosed has no parameters. When the user selects an
* item in the Font Panel, the system will send a
* kEventFontSelection event to the event target specified when the
* application called SetFontPanelInfo(). kEventFontSelection will
* contain parameters reflecting the current Font Panel selection in
* all supported formats. Font events are available after Mac OS X
* 10.2 in the Carbon framework.
}
const
{
* The Font Panel has been closed. The application should update its
* corresponding UI element (e.g., a menu item) accordingly.
}
kEventFontPanelClosed = 1;
{
* The user has specified font settings in the Font Panel. The
* application can obtain these settings from the event, in which
* they are stored as parameters. Not all parameters are guaranteed
* to be present; the application should check for all those which it
* recognizes and apply the ones found as appropriate to the target
* text.
}
kEventFontSelection = 2;
{
Parameters for font events:
kEventFontPanelClosed
None.
kEventFontSelection
--> kEventParamATSUFontID typeATSUFontID
--> kEventParamATSUFontSize typeATSUSize
--> kEventParamFMFontFamily typeFMFontFamily
--> kEventParamFMFontSize typeFMFontSize
--> kEventParamFontColor typeFontColor
--> kEventParamDictionary typeCFDictionary
}
const
typeATSUFontID = typeUInt32; { ATSUI font ID.}
typeATSUSize = typeFixed; { ATSUI font size.}
typeFMFontFamily = typeSInt16; { Font family reference.}
typeFMFontStyle = typeSInt16; { Quickdraw font style}
typeFMFontSize = typeSInt16; { Integer font size.}
typeFontColor = typeRGBColor; { Font color spec (optional).}
kEventParamATSUFontID = $61756964 (* 'auid' *); { typeATSUFontID}
kEventParamATSUFontSize = $6175737A (* 'ausz' *); { typeATSUSize}
kEventParamFMFontFamily = $666D666D (* 'fmfm' *); { typeFMFontFamily}
kEventParamFMFontStyle = $666D7374 (* 'fmst' *); { typeFMFontStyle}
kEventParamFMFontSize = $666D737A (* 'fmsz' *); { typeFMFontSize}
kEventParamFontColor = $66636C72 (* 'fclr' *); { typeFontColor}
kEventParamDictionary = $64696374 (* 'dict' *); { typeCFDictionaryRef}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Key constants to be used to access data inside the dictionary that may
be contained in the kEventFontSelection dictionary.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{
* kFontPanelATSUFontIDKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelATSUFontIDKey: CFStringRef; external name '_kFontPanelATSUFontIDKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{Value is a CFNumber containing the ATSU Font ID}
{
* kFontPanelVariationAxesKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelVariationAxesKey: CFStringRef; external name '_kFontPanelVariationAxesKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{ Value is a CFDataRef containing one or more ATSUI Variation Axes}
{
* kFontPanelVariationValuesKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelVariationValuesKey: CFStringRef; external name '_kFontPanelVariationValuesKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{Value is a CFDataRef containing one or more ATSU Variation values}
{
* kFontPanelFeatureTypesKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelFeatureTypesKey: CFStringRef; external name '_kFontPanelFeatureTypesKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{ Value is a CFDataRef containing one or more ATSUI feature types}
{
* kFontPanelFeatureSelectorsKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelFeatureSelectorsKey: CFStringRef; external name '_kFontPanelFeatureSelectorsKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{ Value is a CFDataRef containing one or more ATSUI feature selectors}
{
* kFontPanelAttributesKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelAttributesKey: CFStringRef; external name '_kFontPanelAttributesKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
const <CFString> string kFontPanelAttributesKey = "FontAttributes";
Value is a CFDictionaryRef containing three keyed values. Each value is
a CFDataRef. One CFDataRef contains one or more ATSUAttributeTags.
One CFDataRef contains one or more value sizes for each tag. And the last
CFDataRef contains the actual values. It is important to understand that
these are the actual values and not value ptrs. To pass these values to
ATSUI they must be converted into ptrs. The following code fragment demonstrates
one technique
CFDataRef values;
CFDataRef tags;
CFDataRef sizes;
if ( CFDictionaryGetValueIfPresent( attributesDict, kFontPanelAttributeValuesKey, &values ) &&
CFDictionaryGetValueIfPresent( attributesDict, kFontPanelAttributeTagsKey, &tags )
CFDictionaryGetValueIfPresent( attributesDict, kFontPanelAttributeSizesKey, &sizes ))
(
ItemCount count = CFDataGetLength( tags )/sizeof(ATSUAttributeTag);
CFIndex index;
ATSUAttributeValuePtr valuePtrs = malloc( count * sizeof(ATSUAttributeValuePtr) );
UInt32* sizePtr = (UInt32*)CFDataGetBytePtr(sizes);
UInt32* bytePtr = (UInt32*)CFDataGetBytePtr(values);
for ( index = 0; index < count; index++ )
(
valuePtrs[index] = bytePtr;
bytePtr = (UInt32*)( (UInt8*)bytePtr + sizePtr[index]);
)
verify_noerr( ATSUSetAttributes( someATSUStyle, count, (ATSUAttributeTag*)CFDataGetBytePtr(tags),sizePtr, valuePtrs ) );
free( valuePtrs );
}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Keys to access the CFDataRefs inside the attributes dictionary (see above)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{
* kFontPanelAttributeTagsKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelAttributeTagsKey: CFStringRef; external name '_kFontPanelAttributeTagsKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{Value is a CFDataRef containing one or more style attribute tags}
{
* kFontPanelAttributeSizesKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelAttributeSizesKey: CFStringRef; external name '_kFontPanelAttributeSizesKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{Value is a CFDataRef containing one or more style attribute sizes}
{
* kFontPanelAttributeValuesKey
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFontPanelAttributeValuesKey: CFStringRef; external name '_kFontPanelAttributeValuesKey'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{Value is a CFDataRef containing one or more style values}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Other Font Panel Constants
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{
Error codes (Font Panel codes in range [-8880,-8899]).
}
const
fontPanelShowErr = -8880; { Can't display the Font Panel.}
fontPanelSelectionStyleErr = -8881; { Bad font selection style info.}
fontPanelFontSelectionQDStyleVersionErr = -8882; { Unsupported record version.}
{
Type of font information passed in SetFontPanelInfo(). If the client is
sending ATSUI style data, it specifies kFontSelectionATSUIType; if it is
sending Quickdraw style data, it specifies kFontSelectionQDType.
}
const
kFontSelectionATSUIType = $6173746C (* 'astl' *); { Use ATSUIStyle collection.}
kFontSelectionQDType = $7173746C (* 'qstl' *); { Use FontSelectionQDStyle record.}
{
Supported versions of the FontSelectionQDStyle record. Clients should always set
the <version> field to one of these values.
}
const
kFontSelectionQDStyleVersionZero = 0;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Font Panel Types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{
Record specifying the font information to be specified in the Font
Panel. This record is used if the client is sending Quickdraw style data
(i.e., it specified kFontSelectionQDType in SetFontPanelInfo()).
}
type
FontSelectionQDStyle = record
version: UInt32; { Version number of struct.}
instance: FMFontFamilyInstance; { Font instance data.}
size: FMFontSize; { Size of font in points.}
hasColor: Boolean; { true if color info supplied.}
reserved: SInt8; { Filler byte.}
color: RGBColor; { Color specification for font.}
end;
FontSelectionQDStylePtr = ^FontSelectionQDStyle;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Font Panel Functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{
* FPIsFontPanelVisible()
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework
* CarbonLib: not available in CarbonLib 1.x
* Non-Carbon CFM: not available
}
function FPIsFontPanelVisible: Boolean; external name '_FPIsFontPanelVisible';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* FPShowHideFontPanel()
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework
* CarbonLib: not available in CarbonLib 1.x
* Non-Carbon CFM: not available
}
function FPShowHideFontPanel: OSStatus; external name '_FPShowHideFontPanel';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* SetFontInfoForSelection()
*
* Availability:
* Mac OS X: in version 10.2 and later in Carbon.framework
* CarbonLib: not available in CarbonLib 1.x
* Non-Carbon CFM: not available
}
function SetFontInfoForSelection( iStyleType: OSType; iNumStyles: UInt32; iStyles: {variable-size-array} UnivPtr; iFPEventTarget: EventTargetRef ): OSStatus; external name '_SetFontInfoForSelection';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Font Collection Functions
In 10.3 the ability to create and modify font collections is available. Font
collections are files containing font descriptions. Font descriptions are
encapsulated in the opaque object FCFontDescriptorRef. A FCFontDescriptroRef
is a CFType. To release one call CFRelease.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Font Collection Types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
type
FCFontDescriptorRef = ^SInt32; { an opaque 32-bit type }
{
* FCCopyCollectionNames()
*
* Discussion:
* FCCopyCollectionNames returns a copy of the CFArrayRef containing
* the displayable names of every font collection available to the
* current user.
*
* Result:
* A CFArrayRef containing CFStringRefs where each CFStringRef
* contains a font collection's displayable name. Callers are
* responsible for releasing the returned CFArrayRef. If the
* operation is not successful NULL is returned.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function FCCopyCollectionNames: CFArrayRef; external name '_FCCopyCollectionNames';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* FCCopyFontDescriptorsInCollection()
*
* Discussion:
* FCCopyFontDescriptorsInCollection copies the fontDescriptors in a
* named collection into an array.
*
* Parameters:
*
* iCollection:
* The name of a collection that descriptors should be copied from.
*
* Result:
* A CFArrayRef containing copies of the FCFontDescriptorRefs
* contained in the name collection. Callers are responsible for
* releasing the returned CFArrayRef. The FCFontDescriptorRefs are
* retained when added to the array and released when the array is
* destroyed. You can access a font descriptor in the array in the
* following manner: fd =
* (FCFontDescriptorRef)CFArrayGetValueAtIndex(array, i);
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function FCCopyFontDescriptorsInCollection( iCollection: CFStringRef ): CFArrayRef; external name '_FCCopyFontDescriptorsInCollection';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* FCAddCollection()
*
* Discussion:
* Add a collection to the font descriptor collections available to
* the current user. If the collection is successfully added noErr
* is returned. If the collection is not added an error code is
* returned.
*
* Parameters:
*
* iCollection:
* the name of the collection to add.
*
* iCollectionOptions:
* currently there are no options. Set to kNilOptions. This
* parameter is available for future expansion.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function FCAddCollection( iCollection: CFStringRef; iCollectionOptions: OptionBits ): OSStatus; external name '_FCAddCollection';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* FCRemoveCollection()
*
* Discussion:
* Remove a named collection from the font descriptor collections
* available to the current user. Returns noErr if the collection
* was successfully removed. An appropriate error code is returned
* if the operation was not successful.
*
* Parameters:
*
* iCollection:
* the name of the collection to remove.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function FCRemoveCollection( iCollection: CFStringRef ): OSStatus; external name '_FCRemoveCollection';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* FCAddFontDescriptorToCollection()
*
* Discussion:
* Add a font descriptor to the named collection. noErr is returned
* if the font descriptor is added. An error code describing the
* failure is returned if the descriptor is not added.
*
* Parameters:
*
* iDescriptor:
* the font descriptor that should be added. The
* FCFontDescriptorRef is retained when it is added to the
* collection. After calling this function the caller may release
* their copy.
*
* iCollection:
* the name of the collection to which the font descriptor should
* be added.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function FCAddFontDescriptorToCollection( iDescriptor: FCFontDescriptorRef; iCollection: CFStringRef ): OSStatus; external name '_FCAddFontDescriptorToCollection';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* FCRemoveFontDescriptorFromCollection()
*
* Discussion:
* Remove a font descriptor from the named collection. An error is
* returned if the font descriptor can not be removed. noErr is
* returned if the descriptor is removed.
*
* Parameters:
*
* iDescriptor:
* the descriptor that should be removed.
*
* iCollection:
* the name of the collection that the descriptor should be
* removed from.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function FCRemoveFontDescriptorFromCollection( iDescriptor: FCFontDescriptorRef; iCollection: CFStringRef ): OSStatus; external name '_FCRemoveFontDescriptorFromCollection';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Font Descriptor Attribute Keys
Font Descriptors contain font attributes that are set and accessed via a set of
keys. The keys are all constant CFStringRefs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{
* kFCFontFamilyAttribute
*
* Discussion:
* The key for a CFStringRef that contains a font family name (e.g.
* Baskerville).
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFCFontFamilyAttribute: CFStringRef; external name '_kFCFontFamilyAttribute'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* kFCFontNameAttribute
*
* Discussion:
* The key for a CFStringRef containing a font name (e.g.
* Baskerville-Italic).
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFCFontNameAttribute: CFStringRef; external name '_kFCFontNameAttribute'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* kFCFontFaceAttribute
*
* Discussion:
* The key for a CFStringRef containing a face name (e.g. Italic).
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFCFontFaceAttribute: CFStringRef; external name '_kFCFontFaceAttribute'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* kFCFontSizeAttribute
*
* Discussion:
* The key for a CFNumber containg the font size (e.g. 12).
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFCFontSizeAttribute: CFStringRef; external name '_kFCFontSizeAttribute'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* kFCFontVisibleNameAttribute
*
* Discussion:
* The Key for a CFStringRef containing the name that should be used
* in a UI to describe the font.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFCFontVisibleNameAttribute: CFStringRef; external name '_kFCFontVisibleNameAttribute'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* kFCFontCGColorAttribute
*
* Discussion:
* The Key for a CGColorRef containing the fonts color.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
var kFCFontCGColorAttribute: CFStringRef; external name '_kFCFontCGColorAttribute'; (* attribute const *)
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* FCFontDescriptorCreateWithFontAttributes()
*
* Discussion:
* Create a font descriptor using the attributes contained in the
* dictionary.
*
* Parameters:
*
* iAttributes:
* a dictionary containing one or more of the attributes described
* above.
*
* Result:
* A valid FCFontDescriptorRef. NULL if one cannot be created.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function FCFontDescriptorCreateWithFontAttributes( iAttributes: CFDictionaryRef ): FCFontDescriptorRef; external name '_FCFontDescriptorCreateWithFontAttributes';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
{
* FCFontDescriptorCreateWithName()
*
* Discussion:
* Create a font descriptor using a fontname and font size.
*
* Parameters:
*
* iFontName:
* The name of the font (e.g. Baskerville-Italic).
*
* iSize:
* the size of the font. (e.g. 12.0).
*
* Result:
* A valid FCFontDescriptorRef. NULL if one cannot be created.
*
* Availability:
* Mac OS X: in version 10.3 and later in Carbon.framework
* CarbonLib: not available
* Non-Carbon CFM: not available
}
function FCFontDescriptorCreateWithName( iFontName: CFStringRef; iSize: Float32 ): FCFontDescriptorRef; external name '_FCFontDescriptorCreateWithName';
(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
end.

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// widgetset
WSControls, WSLCLClasses, WSProc,
// LCL Carbon

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// widgetset
WSControls, WSLCLClasses, WSProc,
// LCL Carbon

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// LCL
LCLProc, LCLType, Graphics, GraphType, IntfGraphics, Controls, Forms,
// LCL Carbon

View File

@ -33,11 +33,7 @@ interface
uses
// Bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// Free Pascal
Classes, SysUtils, Types,
// Widgetset

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// LCL
LCLProc, LCLType, Graphics, GraphType;

View File

@ -31,11 +31,7 @@ unit CarbonDebug;
interface
uses
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
sysutils, CarbonUtils;
procedure DbgDumpImage(AImage: CGImageRef; ATitle: String = ''; AWidth: Integer = -1; AHeight: Integer = -1);

View File

@ -35,11 +35,7 @@ interface
uses
// libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// wdgetset
WSLCLClasses, LCLClasses,
// LCL + RTL
@ -154,7 +150,7 @@ type
TEventInt = packed record
case Integer of
1: (Chars: array[0..4] of Char);
2: (Int: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.UInt32);
2: (Int: UInt32);
end;
const

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// LCL
LMessages, LCLMessageGlue, LCLProc, LCLType, Graphics, Controls, StdCtrls, ExtCtrls,
Spin,
@ -611,7 +607,7 @@ begin
if OSError(
CreatePopupButtonControl(GetTopParentWindow,
ParamsToCarbonRect(AParams), nil, -12345, False, 0, popupTitleLeftJust,
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Normal, Widget),
Normal, Widget),
Self, SCreateWidget, 'CreatePopupButtonControl')then RaiseCreateWidgetError(LCLObject);
OSError(CreateNewMenu(0, kMenuAttrAutoDisable, FPopupMenu),
@ -1362,7 +1358,7 @@ end;
procedure TCarbonMemo.CreateWidget(const AParams: TCreateParams);
var
Control: ControlRef;
Options: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.OptionBits;
Options: OptionBits;
R: HIRect;
begin
Options := kTXNMonostyledTextMask or kOutputTextInUnicodeEncodingMask;

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// LCL
LCLProc, LCLType, GraphType, Graphics, Controls, Forms,
// LCL Carbon
@ -173,7 +169,7 @@ type
TCarbonBrush = class(TCarbonColorObject)
private
FCGPattern: CGPatternRef; // TODO
//FCGPattern: CGPatternRef; // TODO
public
constructor Create(AGlobal: Boolean); // create default brush
constructor Create(ALogBrush: TLogBrush);

View File

@ -12,7 +12,7 @@
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
@ -39,11 +39,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, FPCAdds,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// Cocoa bindings
{$ifdef CarbonUseCocoa}
foundation, appkit,
@ -53,7 +49,7 @@ uses
// widgetset
CarbonGDIObjects,
{$ifdef DebugBitmaps}
CarbonDebug,
CarbonDebug,
{$endif}
glgrab,
// LCL

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// LCL
LMessages, LCLMessageGlue, LCLType, LCLProc, Controls, StdCtrls, ComCtrls,
// LCL Carbon

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
CarbonUtils,
// widgetset
WSControls, WSLCLClasses, WSProc,
@ -572,7 +568,7 @@ end;
procedure TCarbonMenu.SetBitmap(const ABitmap: TBitmap);
var
IconType: Byte;
AHandle: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Handle;
AHandle: MacOSAll.Handle;
CGImage: CGImageRef;
const
SName = 'SetBitmap';
@ -714,9 +710,9 @@ begin
if FParentMenu = nil then Exit;
if LCLMenuItem.Default then
Style := {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.bold
Style := MacOSAll.bold
else
Style := {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.normal;
Style := MacOSAll.normal;
SetItemStyle(FParentMenu.Menu, GetIndex + 1, Style);
end;

View File

@ -127,7 +127,7 @@ begin
// Run our event loop until quitNow is set.
Loop;
finally
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.RemoveEventHandler(QuitHandler);
MacOSAll.RemoveEventHandler(QuitHandler);
end;
finally
DisposeEventHandlerUPP(QuitUPP);
@ -438,7 +438,7 @@ begin
ReleaseEvent(DummyEvent);
end;
finally
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.RemoveEventHandler(EventLoopHandler);
MacOSAll.RemoveEventHandler(EventLoopHandler);
end;
finally
DisposeEventHandlerUPP(EventLoopUPP);

View File

@ -32,11 +32,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// widgetset
WSControls, WSLCLClasses, WSProc,
// LCL Carbon

View File

@ -228,7 +228,7 @@ function CarbonCommon_CursorChange(ANextHandler: EventHandlerCallRef;
AEvent: EventRef;
AWidget: TCarbonWidget): OSStatus; {$IFDEF darwin}mwpascal;{$ENDIF}
var
ALocation: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Point;
ALocation: MacOSAll.Point;
AModifiers: UInt32;
ACursorWasSet: Boolean;

View File

@ -364,12 +364,12 @@ end;
------------------------------------------------------------------------------}
function TCarbonControl.GetControlContentRect(var ARect: TRect): Boolean;
var
AClientRect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
ClientRegion: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.RgnHandle;
AClientRect: MacOSAll.Rect;
ClientRegion: MacOSAll.RgnHandle;
begin
Result := False;
ClientRegion := {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.NewRgn();
ClientRegion := MacOSAll.NewRgn();
try
if OSError(GetControlRegion(ControlRef(Widget), kControlContentMetaPart, ClientRegion),
Self, 'GetControlContentRect', 'GetControlRegion') then Exit;
@ -377,7 +377,7 @@ begin
Result := GetRegionBounds(ClientRegion, AClientRect) <> nil;
if Result then ARect := CarbonRectToRect(AClientRect);
finally
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.DisposeRgn(ClientRegion);
MacOSAll.DisposeRgn(ClientRegion);
end;
{$IFDEF VerboseBounds}
@ -471,7 +471,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonControl.EmbedInScrollView(AScrollBars: TScrollStyle): HIViewRef;
var
ScrollOptions: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.OptionBits;
ScrollOptions: MacOSAll.OptionBits;
Bounds: HIRect;
const
SName = 'EmbedInScrollView';
@ -642,7 +642,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonControl.IsVisible: Boolean;
begin
Result := {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.IsControlVisible(Frames[0]);
Result := MacOSAll.IsControlVisible(Frames[0]);
end;
{------------------------------------------------------------------------------
@ -656,16 +656,16 @@ function TCarbonControl.Enable(AEnable: Boolean): Boolean;
var
I: Integer;
begin
Result := not {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.IsControlEnabled(Frames[0]);
Result := not MacOSAll.IsControlEnabled(Frames[0]);
if AEnable then
begin
for I := 0 to GetFrameCount - 1 do
OSError({$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.EnableControl(Frames[I]), Self, SEnable, SEnableControl);
OSError(MacOSAll.EnableControl(Frames[I]), Self, SEnable, SEnableControl);
end
else
for I := 0 to GetFrameCount - 1 do
OSError({$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.DisableControl(Frames[I]), Self, SEnable, SDisableControl);
OSError(MacOSAll.DisableControl(Frames[I]), Self, SEnable, SDisableControl);
end;
{------------------------------------------------------------------------------
@ -678,7 +678,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonControl.GetFrameBounds(var ARect: TRect): Boolean;
var
BoundsRect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
BoundsRect: MacOSAll.Rect;
begin
Result := False;
@ -715,7 +715,7 @@ end;
function TCarbonControl.GetScreenBounds(var ARect: TRect): Boolean;
var
BoundsRect: HIRect;
WindowRect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
WindowRect: MacOSAll.Rect;
const
SName = 'GetScreenBounds';
begin
@ -992,9 +992,9 @@ end;
------------------------------------------------------------------------------}
function TCarbonControl.GetMousePos: TPoint;
var
P: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Point;
P: MacOSAll.Point;
MousePoint: HIPoint;
R: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
R: MacOSAll.Rect;
const
SName = 'GetMousePos';
begin
@ -1043,7 +1043,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonControl.GetPreferredSize: TPoint;
var
R: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
R: MacOSAll.Rect;
S: SmallInt;
begin
Result.X := 0;

View File

@ -416,7 +416,6 @@ const
var KeyCode, DeadKeys: UInt32;
TextLen : UInt32;
CharLen : integer;
buf : array[1..6] of Char; //isn't 4 bytes enough?
widebuf: array[1..2] of widechar;
U: Cardinal;
Layout: UCKeyboardLayoutPtr;
@ -1142,8 +1141,8 @@ end;
------------------------------------------------------------------------------}
function TCarbonWindow.GetMousePos: TPoint;
var
P: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Point;
R: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
P: MacOSAll.Point;
R: MacOSAll.Rect;
begin
GetGlobalMouse(P);
@ -1171,7 +1170,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonWindow.GetClientRect(var ARect: TRect): Boolean;
var
AWndRect, AClientRect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
AWndRect, AClientRect: MacOSAll.Rect;
const
SName = 'GetClientRect';
begin
@ -1230,7 +1229,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonWindow.IsVisible: Boolean;
begin
Result := {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.IsWindowVisible(WindowRef(Widget));
Result := MacOSAll.IsWindowVisible(WindowRef(Widget));
end;
{------------------------------------------------------------------------------
@ -1242,20 +1241,20 @@ end;
------------------------------------------------------------------------------}
function TCarbonWindow.Enable(AEnable: Boolean): boolean;
begin
Result := not {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.IsControlEnabled(Content);
Result := not MacOSAll.IsControlEnabled(Content);
// enable/disable window content
// add/remove standard handler
if AEnable then
begin
OSError({$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.EnableControl(Content), Self, SEnable, SEnableControl);
OSError(MacOSAll.EnableControl(Content), Self, SEnable, SEnableControl);
OSError(
ChangeWindowAttributes(WindowRef(Widget), kWindowStandardHandlerAttribute,
kWindowNoAttributes), Self, SEnable, SChangeWindowAttrs);
end
else
begin
OSError({$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.DisableControl(Content), Self, SEnable, SDisableControl);
OSError(MacOSAll.DisableControl(Content), Self, SEnable, SDisableControl);
OSError(
ChangeWindowAttributes(WindowRef(Widget), kWindowNoAttributes,
kWindowStandardHandlerAttribute), Self, SEnable, SChangeWindowAttrs);
@ -1273,17 +1272,17 @@ end;
------------------------------------------------------------------------------}
function TCarbonWindow.GetBounds(var ARect: TRect): Boolean;
var
AWndRect, AClientRect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
AWndRect, AClientRect: MacOSAll.Rect;
const
SName = 'GetBounds';
begin
Result := False;
if OSError(
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.GetWindowBounds(WindowRef(Widget), kWindowStructureRgn, AWndRect),
MacOSAll.GetWindowBounds(WindowRef(Widget), kWindowStructureRgn, AWndRect),
Self, SName, SGetWindowBounds, 'kWindowStructureRgn') then Exit;
if OSError(
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.GetWindowBounds(WindowRef(Widget), kWindowContentRgn, AClientRect),
MacOSAll.GetWindowBounds(WindowRef(Widget), kWindowContentRgn, AClientRect),
Self, SName, SGetWindowBounds, 'kWindowContentRgn') then Exit;
ARect.Left := AWndRect.Left;
@ -1352,7 +1351,7 @@ begin
Resizing := True;
try
// set window width, height
if OSError({$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.SetWindowBounds(WindowRef(Widget), kWindowContentRgn,
if OSError(MacOSAll.SetWindowBounds(WindowRef(Widget), kWindowContentRgn,
GetCarbonRect(ARect)), Self, SName, 'SetWindowBounds') then Exit;
// set window left, top
if OSError(MoveWindowStructure(WindowRef(Widget), ARect.Left, ARect.Top),
@ -1424,10 +1423,10 @@ begin
if AVisible or (csDesigning in LCLobject.ComponentState) then
begin
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.ShowWindow(WindowRef(Widget));
MacOSAll.ShowWindow(WindowRef(Widget));
end
else
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.HideWindow(WindowRef(Widget));
MacOSAll.HideWindow(WindowRef(Widget));
end;
{------------------------------------------------------------------------------
@ -1555,7 +1554,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonWindow.Show(AShow: Integer): Boolean;
var
P: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Point;
P: MacOSAll.Point;
Maximized: Boolean;
const
SName = 'Show';

View File

@ -34,11 +34,7 @@ interface
{$I carbondebug.inc}
uses
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
Classes, Types, LCLType, LCLProc, LCLClasses, LMessages,
Controls, SysUtils, Graphics, Math, GraphType;
@ -75,7 +71,7 @@ function ShiftStateToModifiers(const Shift: TShiftState): Byte;
function FindCarbonFontID(const FontName: String): ATSUFontID;
function CarbonFontIDToFontName(ID: ATSUFontID): String;
function FontStyleToQDStyle(const AStyle: TFontStyles): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Style;
function FontStyleToQDStyle(const AStyle: TFontStyles): MacOSAll.Style;
procedure FillStandardDescription(out Desc: TRawImageDescription);
@ -96,9 +92,9 @@ function StringsToCFArray(S: TStrings): CFArrayRef;
function RoundFixed(const F: Fixed): Integer;
function GetCarbonRect(Left, Top, Width, Height: Integer): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
function GetCarbonRect(const ARect: TRect): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
function ParamsToCarbonRect(const AParams: TCreateParams): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
function GetCarbonRect(Left, Top, Width, Height: Integer): MacOSAll.Rect;
function GetCarbonRect(const ARect: TRect): MacOSAll.Rect;
function ParamsToCarbonRect(const AParams: TCreateParams): MacOSAll.Rect;
function ParamsToRect(const AParams: TCreateParams): TRect;
type
@ -112,8 +108,8 @@ function RectToCGRect(const ARect: TRect): CGRect;
function CGRectToRect(const ARect: CGRect): TRect;
function ParamsToHIRect(const AParams: TCreateParams): HIRect;
function CarbonRectToRect(const ARect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect): TRect;
function HIRectToCarbonRect(const ARect: HIRect): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
function CarbonRectToRect(const ARect: MacOSAll.Rect): TRect;
function HIRectToCarbonRect(const ARect: HIRect): MacOSAll.Rect;
function PointToHIPoint(const APoint: TPoint): HIPoint;
function PointToHISize(const APoint: TPoint): HISize;
@ -125,8 +121,8 @@ function ColorToRGBColor(const AColor: TColor): RGBColor;
function RGBColorToColor(const AColor: RGBColor): TColor;
function CreateCGColor(const AColor: TColor): CGColorRef;
function DbgS(const ARect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect): string; overload;
function DbgS(const AColor: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.RGBColor): string; overload;
function DbgS(const ARect: MacOSAll.Rect): string; overload;
function DbgS(const AColor: MacOSAll.RGBColor): string; overload;
function DbgS(const APoint: HIPoint): string; overload;
function DbgS(const ASize: HISize): string; overload;
@ -502,13 +498,13 @@ end;
Params: AStyle - Font style
Returns: QuickDraw Style
------------------------------------------------------------------------------}
function FontStyleToQDStyle(const AStyle: TFontStyles): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Style;
function FontStyleToQDStyle(const AStyle: TFontStyles): MacOSAll.Style;
begin
Result := {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.normal;
Result := MacOSAll.normal;
if fsBold in AStyle then Result := Result or {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.bold;
if fsItalic in AStyle then Result := Result or {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.italic;
if fsUnderline in AStyle then Result := Result or {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.underline;
if fsBold in AStyle then Result := Result or MacOSAll.bold;
if fsItalic in AStyle then Result := Result or MacOSAll.italic;
if fsUnderline in AStyle then Result := Result or MacOSAll.underline;
// fsStrikeOut has no counterpart?
end;
@ -720,7 +716,7 @@ end;
Params: Left, Top, Width, Height - Coordinates
Returns: Carbon Rect
------------------------------------------------------------------------------}
function GetCarbonRect(Left, Top, Width, Height: Integer): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
function GetCarbonRect(Left, Top, Width, Height: Integer): MacOSAll.Rect;
begin
Result.Left := Left;
Result.Top := Top;
@ -733,7 +729,7 @@ end;
Params: ARect - Rectangle
Returns: Carbon Rect
------------------------------------------------------------------------------}
function GetCarbonRect(const ARect: TRect): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
function GetCarbonRect(const ARect: TRect): MacOSAll.Rect;
begin
Result.Left := ARect.Left;
Result.Top := ARect.Top;
@ -746,7 +742,7 @@ end;
Params: AParams - Creation parameters
Returns: Carbon Rect from creation parameters
------------------------------------------------------------------------------}
function ParamsToCarbonRect(const AParams: TCreateParams): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
function ParamsToCarbonRect(const AParams: TCreateParams): MacOSAll.Rect;
begin
Result.Left := AParams.X;
Result.Top := AParams.Y;
@ -913,7 +909,7 @@ end;
Params: ARect - Carbon Rect
Returns: Rectangle
------------------------------------------------------------------------------}
function CarbonRectToRect(const ARect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect): TRect;
function CarbonRectToRect(const ARect: MacOSAll.Rect): TRect;
begin
Result.Left := ARect.Left;
Result.Top := ARect.Top;
@ -926,7 +922,7 @@ end;
Params: ARect - HIRect
Returns: Carbon Rect
------------------------------------------------------------------------------}
function HIRectToCarbonRect(const ARect: HIRect): {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
function HIRectToCarbonRect(const ARect: HIRect): MacOSAll.Rect;
begin
if CGRectIsNull(ARect) <> 0 then
begin // CGRect passed is invalid!
@ -1050,13 +1046,13 @@ begin
Result := CGColorCreate(RGBColorSpace, @F[0]);
end;
function DbgS(const ARect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect): String;
function DbgS(const ARect: MacOSAll.Rect): String;
begin
Result := DbgS(ARect.left) + ', ' + DbgS(ARect.top)
+ ', ' + DbgS(ARect.right) + ', ' + DbgS(ARect.bottom);
end;
function DbgS(const AColor: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.RGBColor): String;
function DbgS(const AColor: MacOSAll.RGBColor): String;
begin
Result :=
'R: ' + IntToHex(AColor.Red, 4) +

View File

@ -27,11 +27,7 @@ interface
uses
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// rtl+ftl
Types, Classes, SysUtils, Math,
// LCL

View File

@ -29,11 +29,7 @@ uses
// rtl+ftl
Types, Classes, SysUtils, Math, Contnrs,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// widgetset
WSControls, WSLCLClasses, WSProc,
// LCL Carbon
@ -741,14 +737,14 @@ end;
------------------------------------------------------------------------------}
function TCarbonTabsControl.GetClientRect(var ARect: TRect): Boolean;
var
AClientRect: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
AClientRect: MacOSAll.Rect;
begin
Result := False;
//DebugLn('TCarbonTabsControl.GetClientRect');
if OSError(GetControlData(ControlRef(Widget), kControlEntireControl,
kControlTabContentRectTag, SizeOf({$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect), @AClientRect, nil),
kControlTabContentRectTag, SizeOf(MacOSAll.Rect), @AClientRect, nil),
Self, 'GetClientRect', 'GetControlData') then Exit;
ARect := CarbonRectToRect(AClientRect);

View File

@ -15,11 +15,7 @@ uses
// rtl
Types, Classes, SysUtils,
// carbon bindings
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// lcl
LCLType, LCLProc, LCLIntf, Graphics, Themes, TmSchema,
// widgetset
@ -69,8 +65,8 @@ function TCarbonThemeServices.GetDrawState(Details: TThemedElementDetails): Them
kThemeStateUnavailable = 7;
kThemeStateUnavailableInactive = 8;
kThemeStatePressedUp = 2; { draw with up pressed (increment/decrement buttons) }
kThemeStatePressedDown = 3; { draw with down pressed (increment/decrement buttons) }
kThemeStatePressedUp = 2; draw with up pressed (increment/decrement buttons)
kThemeStatePressedDown = 3; draw with down pressed (increment/decrement buttons)
}
begin

View File

@ -35,11 +35,7 @@ interface
{$I carbondebug.inc}
uses
{$ifdef ver2_2_0}
FPCMacOSAll;
{$else}
MacOSAll;
{$endif}
type
TFourCC = packed array[0..3] of Char;

View File

@ -1160,7 +1160,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonWidgetSet.GetCursorPos(var lpPoint: TPoint): Boolean;
var
Pt: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Point;
Pt: MacOSAll.Point;
begin
Result := False;
@ -1606,7 +1606,7 @@ end;
------------------------------------------------------------------------------}
function TCarbonWidgetSet.GetSysColor(NIndex: Integer): DWORD;
var
C: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.RGBColor;
C: MacOSAll.RGBColor;
Depth: SInt16;
R: OSStatus;
begin
@ -3216,8 +3216,8 @@ var
Window: WindowRef;
Control: ControlRef;
WindowPart: WindowPartCode;
P: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Point;
R: {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.Rect;
P: MacOSAll.Point;
R: MacOSAll.Rect;
begin
Result := 0;

View File

@ -31,11 +31,7 @@ interface
uses
// libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// LCL
Classes, Controls, Buttons, LCLType, LCLProc, Graphics,
// widgetset

View File

@ -31,11 +31,7 @@ interface
uses
// libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// LCL
Classes, Controls, ComCtrls, StdCtrls, LCLType, LCLProc, Graphics, Math, ImgList,
// widgetset

View File

@ -31,11 +31,7 @@ interface
uses
// libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
CarbonUtils, Classes, SysUtils,
// LCL
Forms, Controls, Graphics, LCLType, LMessages, LCLProc,

View File

@ -31,14 +31,7 @@ interface
uses
// libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
{$IFDEF VER2_0}
FontPanel, // will be removed
{$ENDIF}
// LCL
Classes, SysUtils, Controls, Dialogs, LCLType, LCLProc, Masks, Graphics,
// widgetset
@ -516,11 +509,11 @@ begin
begin
//DebugLn('Style: ' + DbgS(Style));
FontDialog.Font.Style := [];
if (Style and {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.bold) > 0 then
if (Style and MacOSAll.bold) > 0 then
FontDialog.Font.Style := FontDialog.Font.Style + [fsBold];
if (Style and {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.italic) > 0 then
if (Style and MacOSAll.italic) > 0 then
FontDialog.Font.Style := FontDialog.Font.Style + [fsItalic];
if (Style and {$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.underline) > 0 then
if (Style and MacOSAll.underline) > 0 then
FontDialog.Font.Style := FontDialog.Font.Style + [fsUnderline];
end;
@ -629,7 +622,7 @@ begin
CarbonWidgetSet.SetMainMenuEnabled(False);
FontDialog := AFontDialog;
{$ifdef ver2_2_0}FPCMacOSAll{$else}MacOSAll{$endif}.ShowWindow(Dialog);
MacOSAll.ShowWindow(Dialog);
// show font panel
if not FPIsFontPanelVisible then

View File

@ -31,11 +31,7 @@ interface
uses
// libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// Cocoa
{$ifdef CarbonUseCocoa}
appkit, foundation, objc,

View File

@ -31,11 +31,7 @@ interface
uses
// Libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
CarbonUtils,
// LCL
Controls, Forms, Graphics, LCLType, LMessages, LCLProc, Classes,

View File

@ -31,11 +31,7 @@ interface
uses
// Libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
CarbonUtils,
// LCL
Controls, Forms, Menus, Graphics, LCLType, LMessages, LCLProc, Classes,

View File

@ -31,11 +31,7 @@ interface
uses
// libs
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
// LCL
Classes, Controls, StdCtrls, LCLType, LCLProc, Graphics, Math,
// widgetset

View File

@ -26,11 +26,7 @@ interface
#import <OpenGL/OpenGL.h>
#import <OpenGL/gl.h>}
uses
{$ifdef ver2_2_0}
FPCMacOSAll,
{$else}
MacOSAll,
{$endif}
GL, OpenGL;
function grabViaOpenGL(display: CGDirectDisplayID; srcRect: CGRect): CGImageRef;

View File

@ -7,8 +7,8 @@
</issue>
<issue name="TWidgetSet">
<short>Keyboard</short>
<descr>* Apple Command key is mapped to ssCtrl per [http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html Apple Guidelines]
* Apple Control key is mapped to ssMeta
<descr>* Apple Command key is mapped to ssMeta
* Apple Control key is mapped to ssCtrl
* Apple Option key is mapped to its inscription, i.e. ssAlt
* Virtual key codes mapping is not reliable (depends on keyboard language layout!)</descr>
</issue>
@ -74,12 +74,6 @@ After obtaining a CGImageRef, the next step to implement the RawImage_fromDevice
<short>Combo box height is constrined</short>
<descr>It's impossible to set an arbitrary height to a TComboBox under Carbon. Use AutoSize to make sure the size is good on all platforms.</descr>
</issue>
<issue name="TComboBox.OnDropDown">
<short>Combo box OnDropDown event is called when set focus</short>
</issue>
<issue name="TComboBox.OnCloseUp">
<short>Combo box OnCloseUp event is called when released focus</short>
</issue>
<issue name="TComboBox.DroppedDown">
<short>Combo box DroppedDown property does not show drop down list when style is csDropDownList</short>
</issue>

View File

@ -16,10 +16,7 @@ unit opengl;
{$Packrecords C}
{$packenum 4} // verifyed with sizeof in C
{$calling cdecl}
{$ifndef ver_2_2_0}
// fpc 2.2.0 doesn't support $linkframework
{$linkframework OpenGL}
{$endif}
{$endif}
interface