diff options
author | sekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-05-31 09:05:21 +0000 |
---|---|---|
committer | sekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-05-31 09:05:21 +0000 |
commit | 59ae98e700b4774a123e62435b54c1141380fcaa (patch) | |
tree | 5d7dbf741825884b632fba5a87fb2283dfd9191a | |
parent | 6c6aa999c078adae842ec37b44a7deafb27b7134 (diff) | |
download | fpGUI-59ae98e700b4774a123e62435b54c1141380fcaa.tar.xz |
Renamed SetFont_ to DoSetFont. Carbon interface now compiles, links and runs (but doesn't do anything)
-rw-r--r-- | examples/gfx/helloworld/helloworld.lpi | 9 | ||||
-rw-r--r-- | gfx/carbon/fpgfxpackage.pas | 4 | ||||
-rw-r--r-- | gfx/carbon/gfx_carbon.pas | 335 | ||||
-rw-r--r-- | gfx/gdi/gfx_gdi.pas | 4 | ||||
-rw-r--r-- | gfx/gfxbase.pas | 4 | ||||
-rw-r--r-- | gfx/template/gfx_xxx.pas | 8 | ||||
-rw-r--r-- | gfx/x11/gfx_x11.pas | 6 |
7 files changed, 340 insertions, 30 deletions
diff --git a/examples/gfx/helloworld/helloworld.lpi b/examples/gfx/helloworld/helloworld.lpi index 2d7e4e84..6347b8e1 100644 --- a/examples/gfx/helloworld/helloworld.lpi +++ b/examples/gfx/helloworld/helloworld.lpi @@ -38,12 +38,15 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <SearchPaths> - <LCLWidgetType Value="win32"/> - </SearchPaths> <CodeGeneration> <Generate Value="Faster"/> </CodeGeneration> + <Linking> + <Options> + <PassLinkerOptions Value="True"/> + <LinkerOptions Value="-framework carbon"/> + </Options> + </Linking> <Other> <CustomOptions Value="-FUunits "/> diff --git a/gfx/carbon/fpgfxpackage.pas b/gfx/carbon/fpgfxpackage.pas index f6e51e3b..d0ef0da0 100644 --- a/gfx/carbon/fpgfxpackage.pas +++ b/gfx/carbon/fpgfxpackage.pas @@ -7,8 +7,8 @@ unit fpgfxpackage; interface uses - GfxBase, GFX_X11, gfxinterface, schar16, unitkeys, fpgfx, GELDirty, GELImage, - CommandLineParams, fpUTF8Utils; + GfxBase, gfx_carbon, gfxinterface, schar16, unitkeys, fpgfx, GELDirty, + GELImage, CommandLineParams, fpUTF8Utils; implementation diff --git a/gfx/carbon/gfx_carbon.pas b/gfx/carbon/gfx_carbon.pas index 745e3afb..c1236e4c 100644 --- a/gfx/carbon/gfx_carbon.pas +++ b/gfx/carbon/gfx_carbon.pas @@ -25,7 +25,7 @@ uses { Pascal RTL Units } SysUtils, Classes, { Carbon headers } - MacOSXAll, + FPCMacOSAll, { fpGfx units } GfxBase; @@ -46,6 +46,7 @@ type { TCarbonCanvas } TCarbonCanvas = class(TFCustomCanvas) + private protected function DoExcludeClipRect(const ARect: TRect): Boolean; override; function DoIntersectClipRect(const ARect: TRect): Boolean; override; @@ -61,7 +62,7 @@ type procedure DoMaskedCopyRect(ASource, AMask: TFCustomCanvas; const ASourceRect: TRect; const AMaskPos, ADestPos: TPoint); override; procedure DoDrawImageRect(AImage: TFCustomBitmap; ASourceRect: TRect; const ADestPos: TPoint); override; public - constructor Create(AHandle: HDC); + constructor Create; destructor Destroy; override; function MapColor(const AColor: TGfxColor): TGfxPixel; override; function FontCellHeight: Integer; override; @@ -69,25 +70,25 @@ type procedure SaveState; override; procedure RestoreState; override; procedure EmptyClipRect; override; - procedure SetColor_(AColor: TGfxPixel); override; + procedure DoSetColor(AColor: TGfxPixel); override; procedure SetFont(AFont: TFCustomFont); override; procedure SetLineStyle(ALineStyle: TGfxLineStyle); override; - property Handle: HDC read FHandle; end; - TCarbonWindowCanvas = class(TxxxCanvas) - private - FWnd: HWND; + { TCarbonWindowCanvas } + + TCarbonWindowCanvas = class(TCarbonCanvas) public - constructor Create(AWnd: HWND); + constructor Create; destructor Destroy; override; end; + { TCarbonBitmapCanvas } - TCarbonBitmapCanvas = class(TxxxCanvas) + TCarbonBitmapCanvas = class(TCarbonCanvas) public - constructor Create(ABitmap: HBITMAP; AWidth, AHeight: Integer); + constructor Create(AWidth, AHeight: Integer); destructor Destroy; override; end; @@ -115,7 +116,6 @@ type TCarbonApplication = class(TFCustomApplication) private - DoBreakRun: Boolean; public { default methods } constructor Create; override; @@ -134,7 +134,7 @@ type procedure SetTitle(const ATitle: String); override; procedure DoSetCursor; override; public - constructor Create(AParent: TFCustomWindow; AWindowOptions: TGfxWindowOptions); override; + constructor Create(AParent: TFCustomWindow; AWindowOptions: TFWindowOptions); override; destructor Destroy; override; procedure DefaultHandler(var Message); override; procedure SetPosition(const APosition: TPoint); override; @@ -152,4 +152,315 @@ type implementation +{ TCarbonFont } + +class function TCarbonFont.GetDefaultFontName(const AFontClass: TGfxFontClass): String; +begin + Result:=inherited GetDefaultFontName(AFontClass); +end; + +constructor TCarbonFont.Create(const Descriptor: String); +begin + +end; + +destructor TCarbonFont.Destroy; +begin + inherited Destroy; +end; + +{ TCarbonCanvas } + +function TCarbonCanvas.DoExcludeClipRect(const ARect: TRect): Boolean; +begin + +end; + +function TCarbonCanvas.DoIntersectClipRect(const ARect: TRect): Boolean; +begin + +end; + +function TCarbonCanvas.DoUnionClipRect(const ARect: TRect): Boolean; +begin + +end; + +function TCarbonCanvas.DoGetClipRect: TRect; +begin + +end; + +procedure TCarbonCanvas.DoDrawArc(const ARect: TRect; StartAngle, EndAngle: Single); +begin + +end; + +procedure TCarbonCanvas.DoDrawCircle(const ARect: TRect); +begin + +end; + +procedure TCarbonCanvas.DoDrawLine(const AFrom, ATo: TPoint); +begin + +end; + +procedure TCarbonCanvas.DoDrawPoint(const APoint: TPoint); +begin + +end; + +procedure TCarbonCanvas.DoFillRect(const ARect: TRect); +begin + +end; + +procedure TCarbonCanvas.DoTextOut(const APosition: TPoint; const AText: String); +begin + +end; + +procedure TCarbonCanvas.DoCopyRect(ASource: TFCustomCanvas; + const ASourceRect: TRect; const ADestPos: TPoint); +begin + +end; + +procedure TCarbonCanvas.DoMaskedCopyRect(ASource, AMask: TFCustomCanvas; + const ASourceRect: TRect; const AMaskPos, ADestPos: TPoint); +begin + +end; + +procedure TCarbonCanvas.DoDrawImageRect(AImage: TFCustomBitmap; + ASourceRect: TRect; const ADestPos: TPoint); +begin + +end; + +constructor TCarbonCanvas.Create; +begin + inherited Create; + +end; + +destructor TCarbonCanvas.Destroy; +begin + inherited Destroy; +end; + +function TCarbonCanvas.MapColor(const AColor: TGfxColor): TGfxPixel; +begin + +end; + +function TCarbonCanvas.FontCellHeight: Integer; +begin + +end; + +function TCarbonCanvas.TextExtent(const AText: String): TSize; +begin + +end; + +procedure TCarbonCanvas.SaveState; +begin + +end; + +procedure TCarbonCanvas.RestoreState; +begin + +end; + +procedure TCarbonCanvas.EmptyClipRect; +begin + +end; + +procedure TCarbonCanvas.DoSetColor(AColor: TGfxPixel); +begin + +end; + +procedure TCarbonCanvas.SetFont(AFont: TFCustomFont); +begin + +end; + +procedure TCarbonCanvas.SetLineStyle(ALineStyle: TGfxLineStyle); +begin + +end; + +{ TCarbonWindowCanvas } + +constructor TCarbonWindowCanvas.Create; +begin + +end; + +destructor TCarbonWindowCanvas.Destroy; +begin + inherited Destroy; +end; + +{ TCarbonBitmapCanvas } + +constructor TCarbonBitmapCanvas.Create(AWidth, AHeight: Integer); +begin + +end; + +destructor TCarbonBitmapCanvas.Destroy; +begin + inherited Destroy; +end; + +{ TCarbonBitmap } + +constructor TCarbonBitmap.Create(AWidth, AHeight: Integer; + APixelFormat: TGfxPixelFormat); +begin + inherited Create(AWidth, AHeight, APixelFormat); +end; + +destructor TCarbonBitmap.Destroy; +begin + inherited Destroy; +end; + +procedure TCarbonBitmap.Lock(var AData: Pointer; var AStride: LongWord); +begin + +end; + +procedure TCarbonBitmap.Unlock; +begin + +end; + +{ TCarbonScreen } + +constructor TCarbonScreen.Create; +begin + inherited Create; +end; + +{ TCarbonApplication } + +constructor TCarbonApplication.Create; +begin + inherited Create; +end; + +destructor TCarbonApplication.Destroy; +begin + inherited Destroy; +end; + +procedure TCarbonApplication.AddWindow(AWindow: TFCustomWindow); +begin + +end; + +procedure TCarbonApplication.Initialize(ADisplayName: String); +begin + +end; + +procedure TCarbonApplication.Run; +begin + +end; + +procedure TCarbonApplication.Quit; +begin + +end; + +{ TCarbonWindow } + +function TCarbonWindow.GetTitle: String; +begin + +end; + +procedure TCarbonWindow.SetTitle(const ATitle: String); +begin + +end; + +procedure TCarbonWindow.DoSetCursor; +begin + +end; + +constructor TCarbonWindow.Create(AParent: TFCustomWindow; AWindowOptions: TFWindowOptions); +begin + +end; + +destructor TCarbonWindow.Destroy; +begin + +end; + +procedure TCarbonWindow.DefaultHandler(var Message); +begin + +end; + +procedure TCarbonWindow.SetPosition(const APosition: TPoint); +begin + +end; + +procedure TCarbonWindow.SetSize(const ASize: TSize); +begin + +end; + +procedure TCarbonWindow.SetMinMaxSize(const AMinSize, AMaxSize: TSize); +begin + +end; + +procedure TCarbonWindow.SetClientSize(const ASize: TSize); +begin + +end; + +procedure TCarbonWindow.SetMinMaxClientSize(const AMinSize, AMaxSize: TSize); +begin + +end; + +procedure TCarbonWindow.Show; +begin + +end; + +procedure TCarbonWindow.Invalidate(const ARect: TRect); +begin + +end; + +procedure TCarbonWindow.PaintInvalidRegion; +begin + +end; + +procedure TCarbonWindow.CaptureMouse; +begin + +end; + +procedure TCarbonWindow.ReleaseMouse; +begin + +end; + end. diff --git a/gfx/gdi/gfx_gdi.pas b/gfx/gdi/gfx_gdi.pas index 7964f222..a8196916 100644 --- a/gfx/gdi/gfx_gdi.pas +++ b/gfx/gdi/gfx_gdi.pas @@ -109,7 +109,7 @@ type procedure SaveState; override; procedure RestoreState; override; procedure EmptyClipRect; override; - procedure SetColor_(AColor: TGfxPixel); override; + procedure DoSetColor(AColor: TGfxPixel); override; procedure SetFont(AFont: TFCustomFont); override; procedure SetLineStyle(ALineStyle: TGfxLineStyle); override; end; @@ -532,7 +532,7 @@ begin end; -procedure TGDICanvas.SetColor_(AColor: TGfxPixel); +procedure TGDICanvas.DoSetColor(AColor: TGfxPixel); begin FColor := AColor; end; diff --git a/gfx/gfxbase.pas b/gfx/gfxbase.pas index e474087d..74c6f637 100644 --- a/gfx/gfxbase.pas +++ b/gfx/gfxbase.pas @@ -331,7 +331,7 @@ type procedure SaveState; virtual; abstract; procedure RestoreState; virtual; abstract; procedure EmptyClipRect; virtual; - procedure SetColor_(AColor: TGfxPixel); virtual; abstract; + procedure DoSetColor(AColor: TGfxPixel); virtual; abstract; procedure SetColor(AColor: TGfxColor); virtual; procedure SetFont(AFont: TFCustomFont); virtual; abstract; procedure SetLineStyle(ALineStyle: TGfxLineStyle); virtual; abstract; @@ -751,7 +751,7 @@ end; procedure TFCustomCanvas.SetColor(AColor: TGfxColor); begin FColor := AColor; - SetColor_(MapColor(AColor)); + DoSetColor(MapColor(AColor)); end; procedure TFCustomCanvas.DrawArc(const ARect: TRect; StartAngle, EndAngle: Single); diff --git a/gfx/template/gfx_xxx.pas b/gfx/template/gfx_xxx.pas index 1084905c..9005f30f 100644 --- a/gfx/template/gfx_xxx.pas +++ b/gfx/template/gfx_xxx.pas @@ -66,16 +66,13 @@ type procedure SaveState; override; procedure RestoreState; override; procedure EmptyClipRect; override; - procedure SetColor_(AColor: TGfxPixel); override; + procedure DoSetColor(AColor: TGfxPixel); override; procedure SetFont(AFont: TFCustomFont); override; procedure SetLineStyle(ALineStyle: TGfxLineStyle); override; - property Handle: HDC read FHandle; end; TxxxWindowCanvas = class(TxxxCanvas) - private - FWnd: HWND; public constructor Create(AWnd: HWND); destructor Destroy; override; @@ -112,7 +109,6 @@ type TxxxApplication = class(TFCustomApplication) private - DoBreakRun: Boolean; public { default methods } constructor Create; override; @@ -131,7 +127,7 @@ type procedure SetTitle(const ATitle: String); override; procedure DoSetCursor; override; public - constructor Create(AParent: TFCustomWindow; AWindowOptions: TGfxWindowOptions); override; + constructor Create(AParent: TFCustomWindow; AWindowOptions: TFWindowOptions); override; destructor Destroy; override; procedure DefaultHandler(var Message); override; procedure SetPosition(const APosition: TPoint); override; diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas index 8f4a12cb..a6f46d40 100644 --- a/gfx/x11/gfx_x11.pas +++ b/gfx/x11/gfx_x11.pas @@ -134,7 +134,7 @@ type procedure SaveState; override; procedure RestoreState; override; procedure EmptyClipRect; override; - procedure SetColor_(AColor: TGfxPixel); override; + procedure DoSetColor(AColor: TGfxPixel); override; procedure SetFont(AFont: TFCustomFont); override; procedure SetLineStyle(ALineStyle: TGfxLineStyle); override; procedure DrawPolyLine(const Coords: array of TPoint); override; @@ -378,7 +378,7 @@ begin FRegion := SavedState^.Region; XSetRegion(GFApplication.Handle, GC, Region); - SetColor_(SavedState^.Color); + DoSetColor(SavedState^.Color); SetFont(SavedState^.Font); Dispose(SavedState); @@ -449,7 +449,7 @@ begin Result := Color.Pixel; end; -procedure TX11Canvas.SetColor_(AColor: TGfxPixel); +procedure TX11Canvas.DoSetColor(AColor: TGfxPixel); begin if AColor <> FCurColor then begin |