summaryrefslogtreecommitdiff
path: root/src/corelib/gdi/fpg_gdi.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2015-04-10 11:35:59 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2015-04-10 11:35:59 +0100
commitac1ade3e6c4c01e6e1137ab1514899e05169538e (patch)
tree100557240a04c2f3c827d3b2d52ab9e671d6a9ac /src/corelib/gdi/fpg_gdi.pas
parentdb31f06d5e7adf28fad60e36fd9e5d2cf0519e84 (diff)
downloadfpGUI-ac1ade3e6c4c01e6e1137ab1514899e05169538e.tar.xz
WinCE: fixes compilation errors for WinCE-ARM
* Disabled OLE support for WinCE * Disabled Drag-n-Drop support for WinCE * Fixed PChar vs PWidechar types * Fixed IFDEF's. Differences between MSWINDOWS, WINDOWS and WINCE.
Diffstat (limited to 'src/corelib/gdi/fpg_gdi.pas')
-rw-r--r--src/corelib/gdi/fpg_gdi.pas37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas
index a1d314f6..eb051fa7 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2015 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -42,7 +42,9 @@ uses
{$IFDEF DEBUG}
,fpg_dbugintf
{$ENDIF DEBUG}
+ {$IFNDEF wince}
,fpg_OLEDragDrop
+ {$ENDIF}
;
{ Constants missing on windows unit }
@@ -153,15 +155,19 @@ type
TfpgGDIWindow = class(TfpgWindowBase)
private
+ {$IFNDEF WINCE}
FDropManager: TfpgOLEDropTarget;
+ {$ENDIF}
FDropPos: TPoint;
FUserMimeSelection: TfpgString;
FUserAcceptDrag: Boolean;
- function GetDropManager: TfpgOLEDropTarget;
+ {$IFNDEF WINCE}
procedure HandleDNDLeave(Sender: TObject);
procedure HandleDNDEnter(Sender: TObject; DataObj: IDataObject; KeyState: Longint; PT: TPoint; var Effect: DWORD);
+ function GetDropManager: TfpgOLEDropTarget;
procedure HandleDNDPosition(Sender: TObject; KeyState: Longint; PT: TPoint; var Effect: TfpgOLEDragDropEffect);
procedure HandleDNDDrop(Sender: TObject; DataObj: IDataObject; KeyState: Longint; PT: TPoint; Effect: TfpgOLEDragDropEffect);
+ {$ENDIF}
private
FMouseInWindow: boolean;
FNonFullscreenRect: TfpgRect;
@@ -171,7 +177,9 @@ type
QueueAcceptDrops: boolean;
function DoMouseEnterLeaveCheck(AWindow: TfpgGDIWindow; uMsg, wParam, lParam: Cardinal): Boolean;
procedure WindowSetFullscreen(aFullScreen, aUpdate: boolean);
+ {$IFNDEF WINCE}
property DropManager: TfpgOLEDropTarget read GetDropManager;
+ {$ENDIF}
protected
FWinHandle: TfpgWinHandle;
FModalForWin: TfpgGDIWindow;
@@ -1445,6 +1453,7 @@ var
// this are required for Windows MouseEnter & MouseExit detection.
uLastWindowHndl: TfpgWinHandle;
+{$IFNDEF WINCE}
procedure TfpgGDIWindow.HandleDNDLeave(Sender: TObject);
var
wg: TfpgWidget;
@@ -1610,6 +1619,7 @@ begin
end;
Result := FDropManager;
end;
+{$ENDIF}
function TfpgGDIWindow.DoMouseEnterLeaveCheck(AWindow: TfpgGDIWindow; uMsg, wParam, lParam: Cardinal): Boolean;
var
@@ -2016,6 +2026,7 @@ end;
procedure TfpgGDIWindow.DoAcceptDrops(const AValue: boolean);
begin
+ {$IFNDEF WINCE}
if AValue then
begin
if HasHandle then
@@ -2029,6 +2040,7 @@ begin
DropManager.RevokeDragDrop;
QueueAcceptDrops := False;
end;
+ {$ENDIF}
end;
procedure TfpgGDIWindow.DoDragStartDetected;
@@ -2066,7 +2078,9 @@ begin
else
begin
+ {$IFNDEF WINCE}
placement.length:= sizeof(placement);
+ // This Windows function doesn't exist in WinCE
if GetWindowPlacement(FWinHandle, placement) then
begin
case placement.ShowCmd of
@@ -2074,6 +2088,7 @@ begin
SW_SHOWMINIMIZED: result:= wsMinimized;
end;
end;
+ {$ENDIF}
end; { case..else }
end; { case }
end;
@@ -2082,7 +2097,9 @@ constructor TfpgGDIWindow.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FWinHandle := 0;
+ {$IFNDEF WINCE}
FDropManager := nil;
+ {$ENDIF}
FDropPos.x := 0;
FDropPos.y := 0;
FFullscreenIsSet := false;
@@ -2092,8 +2109,10 @@ end;
destructor TfpgGDIWindow.Destroy;
begin
+ {$IFNDEF WINCE}
if Assigned(FDropManager) then
FDropManager.Free;
+ {$ENDIF}
inherited Destroy;
end;
@@ -3027,10 +3046,13 @@ var
M: PStgMedium;
itm: TfpgMimeDataItem;
lEffects: DWORD;
+ {$IFNDEF WINCE}
FDataObject: TfpgOLEDataObject;
FDropSource: TfpgOLEDropSource;
+ {$ENDIF}
lIsTranslated: boolean;
begin
+ {$IFNDEF WINCE}
if FDragging then
begin
{$IFDEF DND_DEBUG}
@@ -3121,6 +3143,7 @@ begin
// (FDropSource as IUnknown)._Release;
// (FDataObject as IUnknown)._Release;
end;
+ {$ENDIF}
end;
{ TGDIDragManager }
@@ -3164,18 +3187,22 @@ end;
procedure TGDIDragManager.RegisterDragDrop;
begin
+ {$IFNDEF WINCE}
Activex.RegisterDragDrop(TfpgWidget(FDropTarget).WinHandle, self as IDropTarget)
+ {$ENDIF}
end;
procedure TGDIDragManager.RevokeDragDrop;
begin
+ {$IFNDEF WINCE}
ActiveX.RevokeDragDrop(TfpgWidget(FDropTarget).WinHandle);
+ {$ENDIF}
end;
{$IF FPC_FULLVERSION<20602}
procedure TimerCallBackProc(hWnd: HWND; uMsg: UINT; idEvent: UINT; dwTime: DWORD); stdcall;
{$ELSE}
-procedure TimerCallBackProc(hWnd: HWND; uMsg: UINT; idEvent: UINT_PTR; dwTime: DWORD); stdcall;
+procedure TimerCallBackProc(hWnd: HWND; uMsg: UINT; idEvent: UINT_PTR; dwTime: DWORD); {$IFNDEF WINCE} stdcall; {$ELSE} cdecl; {$ENDIF}
{$IFEND}
begin
{ idEvent contains the handle to the timer that got triggered }
@@ -3240,12 +3267,12 @@ end;
initialization
wapplication := nil;
MouseFocusedWH := 0;
- NeedToUnitialize := Succeeded(OleInitialize(nil));
{$IFDEF WinCE}
UnicodeEnabledOS := True;
FontSmoothingType := DEFAULT_QUALITY;
{$ELSE}
+ NeedToUnitialize := Succeeded(OleInitialize(nil));
WinVersion.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
GetVersionEx(WinVersion);
UnicodeEnabledOS := (WinVersion.dwPlatformID = VER_PLATFORM_WIN32_NT) or
@@ -3256,11 +3283,11 @@ initialization
FontSmoothingType := CLEARTYPE_QUALITY
else
FontSmoothingType := ANTIALIASED_QUALITY;
-{$ENDIF}
finalization
if NeedToUnitialize then
OleUninitialize;
+{$ENDIF}
end.