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

View File

@ -1,4 +1,4 @@
{ 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.
}
@ -7,7 +7,7 @@ unit cocoa_pkg;
interface
uses
appkit, CocoaCoreGraphics, foundation, objc, LazarusPackageIntf;
appkit, foundation, objc, LazarusPackageIntf;
implementation

View File

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

View File

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

View File

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