1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-16 22:35:05 -05:00

Je ziet maar

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@11 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Raymond 2009-09-03 03:59:26 +00:00
parent abb0020dc5
commit ba1e0833b0
6 changed files with 683 additions and 556 deletions

View File

@ -103,13 +103,14 @@ var
{$IFDEF MSWINDOWS}
var
MousePoint : TPoint;
Rect : TRect;
{$ENDIF}
begin
{$IFDEF MSWINDOWS}
Windows.GetCursorPos(MousePoint);
Windows.ScreenToClient( TClient(Client).MWindow.TargetHandle, MousePoint);
x := MousePoint.x;
y := MousePoint.y;
GetWindowRect(TClient(Client).MWindow.TargetHandle,Rect);
x := MousePoint.x - Rect.Left;
y := MousePoint.y - Rect.Top;
{$ENDIF}
{$IFDEF LINUX}
Old_Handler := XSetErrorHandler(@MufasaXErrorHandler);
@ -131,6 +132,7 @@ begin
{$IFDEF MSWINDOWS}
GetWindowRect(TClient(Client).MWindow.TargetHandle, Rect);
Windows.SetCursorPos(x + Rect.Left, y + Rect.Top);
{$ENDIF}
{$IFDEF LINUX}
Old_Handler := XSetErrorHandler(@MufasaXErrorHandler);
@ -229,8 +231,8 @@ begin
{$IFDEF MSWINDOWS}
case mType of
Mouse_Left: Result := (GetAsyncKeyState(VK_LBUTTON) <> 0);
Mouse_Middle: Result := (GetAsyncKeyState(VK_MBUTTON) <> 0)
Mouse_Right: Result := (GetAsyncKeyState(VK_RBUTTON) <> 0)
Mouse_Middle: Result := (GetAsyncKeyState(VK_MBUTTON) <> 0);
mouse_Right: Result := (GetAsyncKeyState(VK_RBUTTON) <> 0);
end;
{$ENDIF}
{$IFDEF LINUX}

View File

@ -5,22 +5,28 @@ unit Window;
interface
uses
Classes, SysUtils, mufasatypes, graphics,
Classes, SysUtils, mufasatypes{$IFDEF MSWINDOWS},windows {$ENDIF}, graphics,
LCLType
{$IFDEF LINUX}, xlib, x, xutil, ctypes{$ENDIF};
type
{ TMWindow }
TMWindow = class(TObject)
function ReturnData(xs, ys, width, height: Integer): PRGB32;
procedure FreeReturnData;
procedure GetDimensions(var W, H: Integer);
function CopyClientToBitmap(xs, ys, xe, ye: integer): TBitmap;
procedure ActivateClient;
{$IFDEF LINUX}
function SetTarget(XWindow: x.TWindow): integer; overload;
{$ENDIF}
{$IFDEF MSWINDOWS}
function UpdateDrawBitmap:boolean;
{$ENDIF}
function SetTarget(Window: THandle; NewType: TTargetWindowMode): integer; overload;
function SetTarget(ArrPtr: PRGB32): integer; overload;
@ -33,9 +39,15 @@ type
// Target Window Mode.
TargetMode: TTargetWindowMode;
{$IFDEF MSWINDOWS}
//Target handle; HWND
TargetHandle : Hwnd;
DrawBmpDataPtr : PRGB32;
//Works on linux as well, test it out
TargetDC : HDC;
DrawBitmap : TBitmap;
{$ENDIF}
{$IFDEF LINUX}
@ -90,6 +102,13 @@ constructor TMWindow.Create(Client: TObject);
begin
inherited Create;
Self.Client := Client;
{$IFDEF MSWINDOWS}
Self.DrawBitmap := TBitmap.Create;
Self.TargetMode:= w_Window;
Self.TargetHandle:= windows.GetDesktopWindow;
Self.TargetDC:= GetWindowDC(Self.TargetHandle);
Self.UpdateDrawBitmap;
{$ENDIF}
{$IFDEF LINUX}
Self.TargetMode := w_XWindow;
@ -106,8 +125,6 @@ begin
Self.DesktopWindow:= RootWindow(Self.XDisplay, Self.XScreenNum);
Self.CurWindow:= Self.DesktopWindow;
{$ELSE}
// Set Target mode for windows.
{$ENDIF}
end;
@ -118,7 +135,11 @@ begin
{$IFDEF LINUX}
XCloseDisplay(Self.XDisplay);
{$ENDIF}
{$IFDEF MSWINDOWS}
if TargetMode = w_Window then
ReleaseDC(TargetHandle,TargetDC);
DrawBitmap.Free;
{$ENDIF}
inherited;
end;
@ -129,6 +150,13 @@ var
{$ENDIF}
begin
case Self.TargetMode of
w_Window:
begin
{$IFDEF MSWINDOWS}
BitBlt(Self.DrawBitmap.Canvas.Handle,0,0, width, height, Self.TargetDC, xs,ys, SRCCOPY);
Result := Self.DrawBmpDataPtr;
{$ENDIF}
end;
w_XWindow:
begin
{$IFDEF LINUX}
@ -190,6 +218,17 @@ begin
hh := ye-ys;
case Self.TargetMode Of
w_Window:
begin
{$IFDEF MSWINDOWS}
if(xs < 0) or (ys < 0) or (xe > W) or (ye > H) then
Writeln('pervet');
Result := TBitmap.Create;
Result.SetSize(ww+1,hh+1);
BitBlt(result.canvas.handle,0,0,ww+1,hh+1,
self.TargetDC,xs,ys, SRCCOPY);
{$ENDIF}
end;
w_XWindow:
begin
{$IFDEF LINUX}
@ -225,6 +264,30 @@ begin
end;
end;
procedure TMWindow.ActivateClient;
begin
{$IFDEF MSWINDOWS}
SetForegroundWindow(Self.TargetHandle);
{$ENDIF}
{$IFDEF LINUX}
XSetInputFocus(Self.XDisplay,Self.CurWindow,RevertToParent,CurrentTime);
{$ENDIF}
end;
{$IFDEF MSWINDOWS} //Probably need one for Linux as well
function TMWindow.UpdateDrawBitmap :boolean;
var
w,h : integer;
BmpInfo : Windows.TBitmap;
begin
GetDimensions(w,h);
DrawBitmap.SetSize(w,h);
GetObject(DrawBitmap.Handle, SizeOf(BmpInfo), @BmpInfo);
DrawBmpDataPtr := BmpInfo.bmBits;
end;
{$ENDIF}
procedure TMWindow.GetDimensions(var W, H: Integer);
{$IFDEF LINUX}
var
@ -233,10 +296,19 @@ var
childwindow : x.TWindow;
Old_Handler: TXErrorHandler;
{$ENDIF}
{$IFDEF MSWINDOWS}
var
Rect : TRect;
{$ENDIF}
begin
case TargetMode of
w_Window:
begin
{$IFDEF MSWINDOWS}
GetWindowRect(Self.TargetHandle, Rect);
w:= Rect.Right - Rect.left + 1;
h:= Rect.Bottom - Rect.Top + 1;
{$ENDIF}
end;
w_XWindow:
begin
@ -280,8 +352,19 @@ begin
if NewType in [ w_XWindow, w_ArrayPtr ] then
begin
// throw exception
Exit;
end;
case NewType of
w_Window :
begin;
ReleaseDC(Self.TargetHandle,Self.TargetDC);
Self.TargetHandle := Window;
Self.TargetDC := GetWindowDC(Window);
end;
end;
{$IFDEF MSWINDOWS}
UpdateDrawBitmap;
{$ENDIF}
end;
function TMWindow.SetTarget(ArrPtr: PRGB32): integer; overload;

View File

@ -6,7 +6,7 @@
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="6"/>
<ActiveEditorIndexAtStart Value="10"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
@ -30,15 +30,15 @@
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="26">
<Units Count="33">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="project1"/>
<CursorPos X="60" Y="16"/>
<CursorPos X="1" Y="19"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<UsageCount Value="44"/>
<EditorIndex Value="0"/>
<UsageCount Value="48"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
@ -49,7 +49,7 @@
<UnitName Value="TestUnit"/>
<CursorPos X="33" Y="57"/>
<TopLine Value="32"/>
<UsageCount Value="44"/>
<UsageCount Value="48"/>
</Unit1>
<Unit2>
<Filename Value="client.pas"/>
@ -57,16 +57,14 @@
<UnitName Value="Client"/>
<CursorPos X="18" Y="34"/>
<TopLine Value="10"/>
<UsageCount Value="44"/>
<UsageCount Value="48"/>
</Unit2>
<Unit3>
<Filename Value="../cogat/Units/CogatUnits/comptypes.pas"/>
<UnitName Value="CompTypes"/>
<CursorPos X="13" Y="531"/>
<TopLine Value="523"/>
<EditorIndex Value="8"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="mufasatypes.pas"/>
@ -74,7 +72,7 @@
<UnitName Value="MufasaTypes"/>
<CursorPos X="52" Y="20"/>
<TopLine Value="1"/>
<UsageCount Value="44"/>
<UsageCount Value="48"/>
</Unit4>
<Unit5>
<Filename Value="window.pas"/>
@ -82,10 +80,10 @@
<UnitName Value="Window"/>
<CursorPos X="4" Y="100"/>
<TopLine Value="85"/>
<UsageCount Value="44"/>
<UsageCount Value="48"/>
</Unit5>
<Unit6>
<Filename Value="../../Documents/fpc/rtl/inc/systemh.inc"/>
<Filename Value="../Documents/fpc/rtl/inc/systemh.inc"/>
<CursorPos X="3" Y="261"/>
<TopLine Value="246"/>
<UsageCount Value="8"/>
@ -96,51 +94,49 @@
<UnitName Value="Input"/>
<CursorPos X="5" Y="20"/>
<TopLine Value="15"/>
<UsageCount Value="43"/>
<UsageCount Value="47"/>
</Unit7>
<Unit8>
<Filename Value="../cogat/Units/CogatUnits/compinput.pas"/>
<UnitName Value="CompInput"/>
<CursorPos X="43" Y="250"/>
<TopLine Value="236"/>
<EditorIndex Value="10"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit8>
<Unit9>
<Filename Value="Units/MMLCore/client.pas"/>
<UnitName Value="Client"/>
<CursorPos X="1" Y="1"/>
<CursorPos X="27" Y="16"/>
<TopLine Value="1"/>
<EditorIndex Value="7"/>
<UsageCount Value="18"/>
<EditorIndex Value="11"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
<Filename Value="Units/MMLCore/input.pas"/>
<UnitName Value="Input"/>
<CursorPos X="42" Y="141"/>
<TopLine Value="125"/>
<EditorIndex Value="2"/>
<UsageCount Value="18"/>
<CursorPos X="52" Y="241"/>
<TopLine Value="234"/>
<EditorIndex Value="1"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit10>
<Unit11>
<Filename Value="Units/MMLCore/mufasatypes.pas"/>
<UnitName Value="MufasaTypes"/>
<CursorPos X="40" Y="19"/>
<CursorPos X="20" Y="3"/>
<TopLine Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="18"/>
<EditorIndex Value="6"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
<Filename Value="Units/MMLCore/window.pas"/>
<UnitName Value="Window"/>
<CursorPos X="20" Y="279"/>
<TopLine Value="258"/>
<EditorIndex Value="4"/>
<UsageCount Value="18"/>
<CursorPos X="14" Y="329"/>
<TopLine Value="185"/>
<EditorIndex Value="7"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit12>
<Unit13>
@ -149,40 +145,34 @@
<UnitName Value="windowutil"/>
<CursorPos X="45" Y="13"/>
<TopLine Value="1"/>
<UsageCount Value="36"/>
<UsageCount Value="40"/>
</Unit13>
<Unit14>
<Filename Value="../../Documents/lazarus/lcl/graphics.pp"/>
<Filename Value="../Documents/lazarus/lcl/graphics.pp"/>
<UnitName Value="Graphics"/>
<CursorPos X="15" Y="1287"/>
<TopLine Value="1272"/>
<EditorIndex Value="0"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit14>
<Unit15>
<Filename Value="../cogat/Units/CogatUnits/compbitmaps.pas"/>
<UnitName Value="CompBitmaps"/>
<CursorPos X="1" Y="109"/>
<TopLine Value="92"/>
<EditorIndex Value="11"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit15>
<Unit16>
<Filename Value="../../Documents/lazarus/lcl/include/rasterimage.inc"/>
<Filename Value="../Documents/lazarus/lcl/include/rasterimage.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="691"/>
<UsageCount Value="9"/>
</Unit16>
<Unit17>
<Filename Value="../../Documents/fpc/packages/x11/src/xlib.pp"/>
<Filename Value="../Documents/fpc/packages/x11/src/xlib.pp"/>
<UnitName Value="xlib"/>
<CursorPos X="47" Y="1272"/>
<TopLine Value="1257"/>
<EditorIndex Value="5"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit17>
<Unit18>
<Filename Value="testunit.pas"/>
@ -190,10 +180,10 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="TestUnit"/>
<CursorPos X="30" Y="72"/>
<TopLine Value="64"/>
<EditorIndex Value="6"/>
<UsageCount Value="15"/>
<CursorPos X="34" Y="61"/>
<TopLine Value="50"/>
<EditorIndex Value="10"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit18>
<Unit19>
@ -201,19 +191,17 @@
<UnitName Value="CompColors"/>
<CursorPos X="44" Y="914"/>
<TopLine Value="897"/>
<EditorIndex Value="9"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
<Filename Value="../../Documents/fpc/packages/x11/src/x.pp"/>
<Filename Value="../Documents/fpc/packages/x11/src/x.pp"/>
<UnitName Value="x"/>
<CursorPos X="4" Y="179"/>
<TopLine Value="164"/>
<UsageCount Value="10"/>
</Unit20>
<Unit21>
<Filename Value="../../Documents/fpc/rtl/unix/aliasctp.inc"/>
<Filename Value="../Documents/fpc/rtl/unix/aliasctp.inc"/>
<CursorPos X="63" Y="45"/>
<TopLine Value="30"/>
<UsageCount Value="10"/>
@ -226,7 +214,7 @@
<UsageCount Value="10"/>
</Unit22>
<Unit23>
<Filename Value="../../Documents/lazarus/lcl/lcltype.pp"/>
<Filename Value="../Documents/lazarus/lcl/lcltype.pp"/>
<UnitName Value="LCLType"/>
<CursorPos X="9" Y="99"/>
<TopLine Value="83"/>
@ -240,134 +228,189 @@
<SyntaxHighlighter Value="LFM"/>
</Unit24>
<Unit25>
<Filename Value="../../Documents/fpc/rtl/unix/unix.pp"/>
<Filename Value="../Documents/fpc/rtl/unix/unix.pp"/>
<UnitName Value="Unix"/>
<CursorPos X="63" Y="63"/>
<TopLine Value="56"/>
<UsageCount Value="10"/>
</Unit25>
<Unit26>
<Filename Value="../Compilertje/Units/CogatUnits/compinput.pas"/>
<UnitName Value="CompInput"/>
<CursorPos X="6" Y="462"/>
<TopLine Value="449"/>
<EditorIndex Value="2"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit26>
<Unit27>
<Filename Value="../FPC/FPCCheckout/rtl/win/wininc/func.inc"/>
<CursorPos X="10" Y="663"/>
<TopLine Value="635"/>
<EditorIndex Value="5"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit27>
<Unit28>
<Filename Value="../Compilertje/Units/CogatUnits/comptypes.pas"/>
<UnitName Value="CompTypes"/>
<CursorPos X="13" Y="418"/>
<TopLine Value="402"/>
<EditorIndex Value="3"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit28>
<Unit29>
<Filename Value="../Compilertje/Units/CogatUnits/compcolors.pas"/>
<UnitName Value="CompColors"/>
<CursorPos X="12" Y="603"/>
<TopLine Value="573"/>
<EditorIndex Value="4"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit29>
<Unit30>
<Filename Value="../lazarus/lcl/graphics.pp"/>
<UnitName Value="Graphics"/>
<CursorPos X="15" Y="1283"/>
<TopLine Value="1270"/>
<EditorIndex Value="8"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit30>
<Unit31>
<Filename Value="../lazarus/lcl/include/rasterimage.inc"/>
<CursorPos X="20" Y="351"/>
<TopLine Value="339"/>
<EditorIndex Value="9"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit31>
<Unit32>
<Filename Value="../lazarus/lcl/intfgraphics.pas"/>
<UnitName Value="IntfGraphics"/>
<CursorPos X="3" Y="3251"/>
<TopLine Value="3245"/>
<UsageCount Value="10"/>
</Unit32>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<JumpHistory Count="29" HistoryIndex="28">
<Position1>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="97" Column="63" TopLine="82"/>
<Filename Value="../Compilertje/Units/CogatUnits/comptypes.pas"/>
<Caret Line="174" Column="9" TopLine="146"/>
</Position1>
<Position2>
<Filename Value="../cogat/Units/CogatUnits/compinput.pas"/>
<Caret Line="8" Column="33" TopLine="1"/>
<Filename Value="../Compilertje/Units/CogatUnits/comptypes.pas"/>
<Caret Line="177" Column="19" TopLine="146"/>
</Position2>
<Position3>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="100" Column="29" TopLine="84"/>
<Filename Value="../Compilertje/Units/CogatUnits/comptypes.pas"/>
<Caret Line="324" Column="19" TopLine="296"/>
</Position3>
<Position4>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="106" Column="42" TopLine="89"/>
<Filename Value="../Compilertje/Units/CogatUnits/compinput.pas"/>
<Caret Line="7" Column="140" TopLine="1"/>
</Position4>
<Position5>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="112" Column="55" TopLine="95"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="18" Column="30" TopLine="1"/>
</Position5>
<Position6>
<Filename Value="testunit.pas"/>
<Caret Line="38" Column="69" TopLine="31"/>
<Filename Value="../Compilertje/Units/CogatUnits/comptypes.pas"/>
<Caret Line="11" Column="138" TopLine="6"/>
</Position6>
<Position7>
<Filename Value="testunit.pas"/>
<Caret Line="60" Column="14" TopLine="37"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="156" Column="10" TopLine="146"/>
</Position7>
<Position8>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="22" Column="48" TopLine="1"/>
<Filename Value="testunit.pas"/>
<Caret Line="58" Column="34" TopLine="43"/>
</Position8>
<Position9>
<Filename Value="testunit.pas"/>
<Caret Line="9" Column="16" TopLine="1"/>
<Caret Line="28" Column="59" TopLine="1"/>
</Position9>
<Position10>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="136" Column="1" TopLine="112"/>
<Filename Value="project1.lpr"/>
<Caret Line="16" Column="60" TopLine="1"/>
</Position10>
<Position11>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="135" Column="125" TopLine="113"/>
<Filename Value="project1.lpr"/>
<Caret Line="19" Column="1" TopLine="1"/>
</Position11>
<Position12>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="127" Column="22" TopLine="113"/>
<Filename Value="testunit.pas"/>
<Caret Line="50" Column="42" TopLine="35"/>
</Position12>
<Position13>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="136" Column="21" TopLine="113"/>
<Filename Value="testunit.pas"/>
<Caret Line="62" Column="32" TopLine="59"/>
</Position13>
<Position14>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="135" Column="2" TopLine="113"/>
<Filename Value="testunit.pas"/>
<Caret Line="57" Column="22" TopLine="41"/>
</Position14>
<Position15>
<Filename Value="testunit.pas"/>
<Caret Line="74" Column="3" TopLine="50"/>
<Filename Value="../Compilertje/Units/CogatUnits/comptypes.pas"/>
<Caret Line="5" Column="109" TopLine="1"/>
</Position15>
<Position16>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="138" Column="31" TopLine="113"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="18" Column="27" TopLine="14"/>
</Position16>
<Position17>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="131" Column="45" TopLine="117"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="169" Column="16" TopLine="159"/>
</Position17>
<Position18>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="92" Column="13" TopLine="75"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="170" Column="16" TopLine="159"/>
</Position18>
<Position19>
<Filename Value="testunit.pas"/>
<Caret Line="51" Column="40" TopLine="34"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="176" Column="14" TopLine="159"/>
</Position19>
<Position20>
<Filename Value="Units/MMLCore/input.pas"/>
<Caret Line="142" Column="1" TopLine="120"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="180" Column="17" TopLine="171"/>
</Position20>
<Position21>
<Filename Value="../cogat/Units/CogatUnits/compinput.pas"/>
<Caret Line="51" Column="35" TopLine="31"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="181" Column="16" TopLine="171"/>
</Position21>
<Position22>
<Filename Value="../cogat/Units/CogatUnits/compinput.pas"/>
<Caret Line="32" Column="35" TopLine="19"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="210" Column="16" TopLine="205"/>
</Position22>
<Position23>
<Filename Value="testunit.pas"/>
<Caret Line="75" Column="47" TopLine="58"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="215" Column="10" TopLine="205"/>
</Position23>
<Position24>
<Filename Value="testunit.pas"/>
<Caret Line="71" Column="19" TopLine="56"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="225" Column="19" TopLine="215"/>
</Position24>
<Position25>
<Filename Value="testunit.pas"/>
<Caret Line="60" Column="3" TopLine="38"/>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="239" Column="19" TopLine="229"/>
</Position25>
<Position26>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="280" Column="20" TopLine="259"/>
<Caret Line="261" Column="17" TopLine="251"/>
</Position26>
<Position27>
<Filename Value="Units/MMLCore/window.pas"/>
<Caret Line="279" Column="7" TopLine="261"/>
<Filename Value="testunit.pas"/>
<Caret Line="68" Column="20" TopLine="53"/>
</Position27>
<Position28>
<Filename Value="testunit.pas"/>
<Caret Line="47" Column="46" TopLine="31"/>
<Filename Value="../Compilertje/Units/CogatUnits/compinput.pas"/>
<Caret Line="9" Column="20" TopLine="1"/>
</Position28>
<Position29>
<Filename Value="testunit.pas"/>
<Caret Line="29" Column="5" TopLine="15"/>
<Filename Value="../Compilertje/Units/CogatUnits/compinput.pas"/>
<Caret Line="40" Column="52" TopLine="29"/>
</Position29>
<Position30>
<Filename Value="project1.lpr"/>
<Caret Line="13" Column="56" TopLine="1"/>
</Position30>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
@ -376,13 +419,6 @@
<IncludeFiles Value="$(ProjOutDir)/"/>
<OtherUnitFiles Value="$(ProjPath)/Units/MMLCore/"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CustomOptions Value="-dUseCThreads"/>
<CompilerPath Value="$(CompPath)"/>

View File

@ -1,11 +1,11 @@
object Form1: TForm1
Left = 293
Height = 516
Top = 200
Left = 966
Height = 527
Top = 461
Width = 779
ActiveControl = Button1
Caption = 'Form1'
ClientHeight = 516
ClientHeight = 527
ClientWidth = 779
LCLVersion = '0.9.29'
object Button1: TButton

View File

@ -1,9 +1,9 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'%'#1#6'Height'#3#4#2#3'Top'#3#200#0#5'Wid'
+'th'#3#11#3#13'ActiveControl'#7#7'Button1'#7'Caption'#6#5'Form1'#12'ClientHe'
+'ight'#3#4#2#11'ClientWidth'#3#11#3#10'LCLVersion'#6#6'0.9.29'#0#7'TButton'#7
+'Button1'#4'Left'#2'E'#6'Height'#2#25#3'Top'#2' '#5'Width'#2'K'#7'Caption'#6
+#7'Button1'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2#0#0#0#0
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#198#3#6'Height'#3#15#2#3'Top'#3#205#1#5'W'
+'idth'#3#11#3#13'ActiveControl'#7#7'Button1'#7'Caption'#6#5'Form1'#12'Client'
+'Height'#3#15#2#11'ClientWidth'#3#11#3#10'LCLVersion'#6#6'0.9.29'#0#7'TButto'
+'n'#7'Button1'#4'Left'#2'E'#6'Height'#2#25#3'Top'#2' '#5'Width'#2'K'#7'Capti'
+'on'#6#7'Button1'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2#0#0#0#0
]);

View File

@ -51,14 +51,19 @@ Var
begin
while (not Terminated) do
begin
Writeln('Creating the client');
Client := TClient.Create;
Writeln('Getting the dimensions');
Client.MWindow.GetDimensions(w, h);
writeln(inttostr(w) + ' , ' + inttostr(h));
//Client.MWindow.SetTarget(77736320);
Writeln('Setting target');
Client.MWindow.SetTarget(132840,w_window);
Client.MWindow.ActivateClient;
Client.MWindow.GetDimensions(w, h);
Writeln('Copying BMP');
bmp := Client.MWindow.CopyClientToBitmap(0, 0, w, h);
bmp.SaveToFile('/tmp/test.bmp');
bmp.SaveToFile('c:\test.bmp');
bmp.Free;
//Sleep(1000);
@ -78,6 +83,7 @@ begin
{ Do comparison here }
inc(ptr);
end;
Client.MWindow.FreeReturnData;
Client.MInput.IsMouseButtonDown(mouse_Left);