Improves Cocoa bindings

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@518 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2008-07-31 15:23:56 +00:00
parent 9576d325a4
commit 0bc35fc726
7 changed files with 18 additions and 166 deletions

View File

@ -1,89 +0,0 @@
{%MainUnit CoreGraphics.pas}
{
CGWindowLevel.h
CoreGraphics
Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
}
//#include <CoreGraphics/CGBase.h>
//#include <stdint.h>
//CG_EXTERN_C_BEGIN
{
* Windows may be assigned to a particular level. When assigned to a level,
* the window is ordered relative to all other windows in that level.
* Windows with a higher level are sorted in front of windows with a lower
* level.
*
* A common set of window levels is defined here for use within higher
* level frameworks. The levels are accessed via a key and function,
* so that levels may be changed or adjusted in future releases without
* breaking binary compatability.
}
type
CGWindowLevel = LongInt;
CGWindowLevelKey = LongInt;
CGCommonWindowLevelKey = (
kCGBaseWindowLevelKey = 0,
kCGMinimumWindowLevelKey,
kCGDesktopWindowLevelKey,
kCGBackstopMenuLevelKey,
kCGNormalWindowLevelKey,
kCGFloatingWindowLevelKey,
kCGTornOffMenuWindowLevelKey,
kCGDockWindowLevelKey,
kCGMainMenuWindowLevelKey,
kCGStatusWindowLevelKey,
kCGModalPanelWindowLevelKey,
kCGPopUpMenuWindowLevelKey,
kCGDraggingWindowLevelKey,
kCGScreenSaverWindowLevelKey,
kCGMaximumWindowLevelKey,
kCGOverlayWindowLevelKey,
kCGHelpWindowLevelKey,
kCGUtilityWindowLevelKey,
kCGDesktopIconWindowLevelKey,
kCGCursorWindowLevelKey,
kCGAssistiveTechHighWindowLevelKey,
kCGNumberOfWindowLevelKeys { Internal bookkeeping; must be last }
);
//CGWindowLevel CGWindowLevelForKey( CGWindowLevelKey key );
{ number of levels above kCGMaximumWindowLevel reserved for internal use }
const
kCGNumReservedWindowLevels = (16);
{ Definitions of older constant values as calls }
kCGBaseWindowLevel = Low(LongInt); { LONG_MIN }
kCGMinimumWindowLevel = kCGBaseWindowLevel + 1; //CGWindowLevelForKey(kCGMinimumWindowLevelKey) /* (kCGBaseWindowLevel + 1) */
kCGDesktopWindowLevel = kCGBaseWindowLevel; //CGWindowLevelForKey(kCGDesktopWindowLevelKey) /* kCGMinimumWindowLevel */
kCGDesktopIconWindowLevel = kCGBaseWindowLevel + 20; //CGWindowLevelForKey(kCGDesktopIconWindowLevelKey) /* kCGMinimumWindowLevel + 20 */
kCGBackstopMenuLevel = -20; //CGWindowLevelForKey(kCGBackstopMenuLevelKey) /* -20 */
kCGNormalWindowLevel = 0; //CGWindowLevelForKey(kCGNormalWindowLevelKey) /* 0 */
kCGFloatingWindowLevel = 3; //CGWindowLevelForKey(kCGFloatingWindowLevelKey) /* 3 */
kCGTornOffMenuWindowLevel = 3; //CGWindowLevelForKey(kCGTornOffMenuWindowLevelKey) /* 3 */
kCGDockWindowLevel = 20; //CGWindowLevelForKey(kCGDockWindowLevelKey) /* 20 */
kCGMainMenuWindowLevel = 24; //CGWindowLevelForKey(kCGMainMenuWindowLevelKey) /* 24 */
kCGStatusWindowLevel = 25; //CGWindowLevelForKey(kCGStatusWindowLevelKey) /* 25 */
kCGModalPanelWindowLevel = 8; //CGWindowLevelForKey(kCGModalPanelWindowLevelKey) /* 8 */
kCGPopUpMenuWindowLevel = 101; //CGWindowLevelForKey(kCGPopUpMenuWindowLevelKey) { 101 }
kCGDraggingWindowLevel = 500; //CGWindowLevelForKey(kCGDraggingWindowLevelKey) { 500 }
kCGScreenSaverWindowLevel = 1000; //CGWindowLevelForKey(kCGScreenSaverWindowLevelKey) { 1000 }
kCGCursorWindowLevel = 2000; //CGWindowLevelForKey(kCGCursorWindowLevelKey) { 2000 }
kCGOverlayWindowLevel = 102; //CGWindowLevelForKey(kCGOverlayWindowLevelKey) { 102 }
kCGHelpWindowLevel = 102; //CGWindowLevelForKey(kCGHelpWindowLevelKey) { 102 }
kCGUtilityWindowLevel = 19; //CGWindowLevelForKey(kCGUtilityWindowLevelKey) { 19 }
kCGAssistiveTechHighWindowLevel = 1500; //CGWindowLevelForKey(kCGAssistiveTechHighWindowLevelKey) { 1500 }
kCGMaximumWindowLevel = High(LongInt) -kCGNumReservedWindowLevels; { LONG_MAX - kCGNumReservedWindowLevels }
//CG_EXTERN_C_END

View File

@ -1,59 +0,0 @@
{
CoreGraphics - CoreGraphics.h
Copyright (c) 2000 Apple Computer, Inc.
All rights reserved.
Main CoreGraphics file. Includes all include files from CoreGraphics
CoreGraphics is located inside the ApplicationServices framework
}
unit CocoaCoreGraphics;
interface
{#include <CoreGraphics/CGBase.h>
#include <CoreGraphics/CGAffineTransform.h>
#include <CoreGraphics/CGBitmapContext.h>
#include <CoreGraphics/CGColor.h>
#include <CoreGraphics/CGColorSpace.h>
#include <CoreGraphics/CGContext.h>
#include <CoreGraphics/CGDataConsumer.h>
#include <CoreGraphics/CGDataProvider.h>
#include <CoreGraphics/CGDirectDisplay.h>
#include <CoreGraphics/CGDirectPalette.h>
#include <CoreGraphics/CGDisplayConfiguration.h>
#include <CoreGraphics/CGDisplayFade.h>
#include <CoreGraphics/CGError.h>
#include <CoreGraphics/CGEvent.h>
#include <CoreGraphics/CGEventSource.h>
#include <CoreGraphics/CGEventTypes.h>
#include <CoreGraphics/CGFont.h>
#include <CoreGraphics/CGFunction.h>
#include <CoreGraphics/CGGLContext.h>
#include <CoreGraphics/CGGeometry.h>
#include <CoreGraphics/CGImage.h>
#include <CoreGraphics/CGLayer.h>
#include <CoreGraphics/CGPDFArray.h>
#include <CoreGraphics/CGPDFContentStream.h>
#include <CoreGraphics/CGPDFContext.h>
#include <CoreGraphics/CGPDFDictionary.h>
#include <CoreGraphics/CGPDFDocument.h>
#include <CoreGraphics/CGPDFObject.h>
#include <CoreGraphics/CGPDFOperatorTable.h>
#include <CoreGraphics/CGPDFPage.h>
#include <CoreGraphics/CGPDFScanner.h>
#include <CoreGraphics/CGPDFStream.h>
#include <CoreGraphics/CGPDFString.h>
#include <CoreGraphics/CGPSConverter.h>
#include <CoreGraphics/CGPath.h>
#include <CoreGraphics/CGPattern.h>
#include <CoreGraphics/CGRemoteOperation.h>
#include <CoreGraphics/CGSession.h>
#include <CoreGraphics/CGShading.h>}
{$include CGWindowLevel.inc}
implementation
end.

View File

@ -5,8 +5,8 @@
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="5"/>
<SearchPaths> <SearchPaths>
<IncludeFiles Value="applicationservices/coregraphics/;foundation/;appkit/;/Users/felipe/Programas/lazarus-ccr/bindings/objc/"/> <IncludeFiles Value="foundation/;appkit/;/Users/felipe/Programas/lazarus-ccr/bindings/objc/"/>
<OtherUnitFiles Value="applicationservices/coregraphics/;foundation/;appkit/;/Users/felipe/Programas/lazarus-ccr/bindings/objc/"/> <OtherUnitFiles Value="foundation/;appkit/;/Users/felipe/Programas/lazarus-ccr/bindings/objc/"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
@ -16,23 +16,19 @@
<CompilerPath Value="$(CompPath)"/> <CompilerPath Value="$(CompPath)"/>
</Other> </Other>
</CompilerOptions> </CompilerOptions>
<Files Count="4"> <Files Count="3">
<Item1> <Item1>
<Filename Value="appkit/appkit.pas"/> <Filename Value="appkit/appkit.pas"/>
<UnitName Value="appkit"/> <UnitName Value="appkit"/>
</Item1> </Item1>
<Item2> <Item2>
<Filename Value="applicationservices/coregraphics/cocoacoregraphics.pas"/>
<UnitName Value="cocoacoregraphics"/>
</Item2>
<Item3>
<Filename Value="foundation/foundation.pas"/> <Filename Value="foundation/foundation.pas"/>
<UnitName Value="foundation"/> <UnitName Value="foundation"/>
</Item3> </Item2>
<Item4> <Item3>
<Filename Value="../objc/objc.pas"/> <Filename Value="../objc/objc.pas"/>
<UnitName Value="objc"/> <UnitName Value="objc"/>
</Item4> </Item3>
</Files> </Files>
<Type Value="RunAndDesignTime"/> <Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="1"> <RequiredPkgs Count="1">

View File

@ -1,5 +1,5 @@
{ This file was automatically created by Lazarus. Do not edit! { This file was automatically created by Lazarus. do not edit!
This source is only used to compile and install the package. This source is only used to compile and install the package.
} }
unit cocoa_pkg; unit cocoa_pkg;
@ -7,7 +7,7 @@ unit cocoa_pkg;
interface interface
uses uses
appkit, CocoaCoreGraphics, foundation, objc, LazarusPackageIntf; appkit, foundation, objc, LazarusPackageIntf;
implementation implementation

View File

@ -33,8 +33,8 @@
<Filename Value="simplewindow.pas"/> <Filename Value="simplewindow.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="simplewindow"/> <UnitName Value="simplewindow"/>
<CursorPos X="63" Y="6"/> <CursorPos X="45" Y="69"/>
<TopLine Value="1"/> <TopLine Value="55"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="106"/> <UsageCount Value="106"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -387,7 +387,7 @@
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit53> </Unit53>
</Units> </Units>
<JumpHistory Count="2" HistoryIndex="1"> <JumpHistory Count="3" HistoryIndex="2">
<Position1> <Position1>
<Filename Value="simplewindow.pas"/> <Filename Value="simplewindow.pas"/>
<Caret Line="67" Column="13" TopLine="45"/> <Caret Line="67" Column="13" TopLine="45"/>
@ -396,6 +396,10 @@
<Filename Value="simplewindow.pas"/> <Filename Value="simplewindow.pas"/>
<Caret Line="49" Column="28" TopLine="36"/> <Caret Line="49" Column="28" TopLine="36"/>
</Position2> </Position2>
<Position3>
<Filename Value="simplewindow.pas"/>
<Caret Line="6" Column="63" TopLine="1"/>
</Position3>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -65,7 +65,7 @@ begin
TextField := NSTextField.initWithFrame(TextFieldRect); TextField := NSTextField.initWithFrame(TextFieldRect);
TextField.setStringValue(CFMessage); TextField.setStringValue(CFMessage);
MainWindowView := NSView.CreateWithHandle(MainWindow.contentView); MainWindowView := NSView.CreateWithHandle(MainWindow.contentView);
MainWindowView.addSubview(TextField); MainWindowView.addSubview(TextField.Handle);
{ Put's the window on the front z-order } { Put's the window on the front z-order }

View File

@ -168,7 +168,7 @@ begin
Result.setBezelStyle(NSRoundedBezelStyle); Result.setBezelStyle(NSRoundedBezelStyle);
Result.setAction(sel_registerName(PChar(ACallbackName))); Result.setAction(sel_registerName(PChar(ACallbackName)));
Result.setTarget(ACallbackClass.Handle); Result.setTarget(ACallbackClass.Handle);
AView.addSubview(Result); AView.addSubview(Result.Handle);
end; end;
function TMyController.CreateMenu(): NSMenu; function TMyController.CreateMenu(): NSMenu;