cocoa: code cleanup

git-svn-id: trunk@22792 -
This commit is contained in:
dmitry 2009-11-26 08:56:01 +00:00
parent 28d6d8fe0e
commit bcbddff7b5
2 changed files with 40 additions and 21 deletions

View File

@ -35,7 +35,7 @@ uses
// carbon bindings
MacOSAll,
// interfacebase
InterfaceBase,
InterfaceBase, GraphType,
// private
CocoaAll, CocoaPrivate, CocoaUtils,
// LCL
@ -88,6 +88,13 @@ type
function DestroyTimer(TimerHandle: THandle): boolean; override;
function AppHandle: THandle; override;
{todo:}
function DCGetPixel(CanvasHandle: HDC; X, Y: integer): TGraphicsColor; override;
procedure DCSetPixel(CanvasHandle: HDC; X, Y: integer; AColor: TGraphicsColor); override;
procedure DCRedraw(CanvasHandle: HDC); override;
procedure DCSetAntialiasing(CanvasHandle: HDC; AEnabled: Boolean); override;
procedure SetDesigning(AComponent: TComponent); override;
// the winapi compatibility methods
{$I cocoawinapih.inc}
// the extra LCL interface methods
@ -244,7 +251,7 @@ begin
{$IFDEF VerboseObject}
DebugLn('TCocoaWidgetSet.AppRestore');
{$ENDIF}
NSApp.unhide(nil);
NSApp.activateIgnoringOtherApps(False);
end;
{------------------------------------------------------------------------------
@ -279,6 +286,9 @@ var
timer : NSTimer;
user : TCocoaTimerObject;
begin
{$IFDEF VerboseObject}
DebugLn('TCocoaWidgetSet.CreateTimer');
{$ENDIF}
user:=TCocoaTimerObject.initWithFunc(TimerFunc);
timer:=NSTimer.timerWithTimeInterval_target_selector_userInfo_repeats(
@ -297,6 +307,9 @@ function TCocoaWidgetSet.DestroyTimer(TimerHandle: THandle): boolean;
var
obj : NSObject;
begin
{$IFDEF VerboseObject}
DebugLn('TCocoaWidgetSet.DestroyTimer');
{$ENDIF}
obj:=NSObject(TimerHandle);
try
Result:= Assigned(obj) and obj.isKindOfClass_(NSTimer);
@ -316,6 +329,31 @@ begin
Result:=THandle(NSApp);
end;
function TCocoaWidgetSet.DCGetPixel(CanvasHandle: HDC; X, Y: integer): TGraphicsColor;
begin
Result:=0;
end;
procedure TCocoaWidgetSet.DCSetPixel(CanvasHandle: HDC; X, Y: integer; AColor: TGraphicsColor);
begin
end;
procedure TCocoaWidgetSet.DCRedraw(CanvasHandle: HDC);
begin
end;
procedure TCocoaWidgetSet.DCSetAntialiasing(CanvasHandle: HDC; AEnabled: Boolean);
begin
inherited DCSetAntialiasing(CanvasHandle, AEnabled);
end;
procedure TCocoaWidgetSet.SetDesigning(AComponent: TComponent);
begin
end;
{------------------------------------------------------------------------------
Method: TCocoaWidgetSet.LCLPlatform
Returns: lpCocoa - enum value for Cocoa widgetset

View File

@ -37,8 +37,6 @@
SW_SHOWNORMAL, SW_MINIMIZE, SW_SHOWMAXIMIZED
------------------------------------------------------------------------------}
function TCocoaWidgetSet.ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean;
{var
CocoaForm: TCocoaForm;}
begin
{$ifdef VerboseCocoaWinAPI}
WriteLn('[WinAPI ShowWindow]');
@ -53,23 +51,6 @@ begin
NSWindow(hwnd).miniaturize(nil);
end;
Result:=true;
{ Result := False;
CocoaForm := TCocoaForm(hWnd);
if CocoaForm <> nil then
begin
case nCmdShow of
SW_SHOW: CocoaForm.MainWindow.orderFront(nil);
SW_SHOWNORMAL: CocoaForm.MainWindow.orderFront(nil);
// SW_MINIMIZE: Widget.setWindowState(QtWindowMinimized);
// SW_SHOWMINIMIZED: Widget.ShowMinimized;
// SW_SHOWMAXIMIZED: Widget.ShowMaximized;
SW_HIDE: CocoaForm.MainWindow.orderOut(nil);
end;
Result := True;
end;}
end;
//##apiwiz##eps## // Do not remove, no wizard declaration after this line