summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-07-12 07:24:59 +0000
committersekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-07-12 07:24:59 +0000
commit651f4edf0db58e02dab94e87d06e26b54f13a22b (patch)
tree02ad288862c56687bc933adfd9a684ab5652cb4e
parent69e6c6fc970d14602875f290f9fcb3cfff2911bb (diff)
downloadfpGUI-651f4edf0db58e02dab94e87d06e26b54f13a22b.tar.xz
Removed use of the dirty list on X11
-rw-r--r--gfx/carbon/gfx_carbon.pas10
-rw-r--r--gfx/gdi/gfx_gdi.pas7
-rw-r--r--gfx/gfxbase.pas1
-rw-r--r--gfx/template/gfx_xxx.pas24
-rw-r--r--gfx/x11/gfx_x11.pas60
5 files changed, 25 insertions, 77 deletions
diff --git a/gfx/carbon/gfx_carbon.pas b/gfx/carbon/gfx_carbon.pas
index e29c5eac..6d1e7bfe 100644
--- a/gfx/carbon/gfx_carbon.pas
+++ b/gfx/carbon/gfx_carbon.pas
@@ -146,8 +146,7 @@ type
procedure SetClientSize(const ASize: TSize); override;
procedure SetMinMaxClientSize(const AMinSize, AMaxSize: TSize); override;
procedure Show; override;
- procedure Invalidate(const ARect: TRect); override;
- procedure PaintInvalidRegion; override;
+ procedure Invalidate; override;
procedure CaptureMouse; override;
procedure ReleaseMouse; override;
end;
@@ -496,12 +495,7 @@ begin
ShowWindow(FHandle);
end;
-procedure TCarbonWindow.Invalidate(const ARect: TRect);
-begin
-
-end;
-
-procedure TCarbonWindow.PaintInvalidRegion;
+procedure TCarbonWindow.Invalidate;
begin
end;
diff --git a/gfx/gdi/gfx_gdi.pas b/gfx/gdi/gfx_gdi.pas
index 64622ab8..2be9f903 100644
--- a/gfx/gdi/gfx_gdi.pas
+++ b/gfx/gdi/gfx_gdi.pas
@@ -201,7 +201,6 @@ type
procedure SetMinMaxClientSize(const AMinSize, AMaxSize: TSize); override;
procedure Show; override;
procedure Invalidate; override;
- procedure PaintInvalidRegion; override;
procedure CaptureMouse; override;
procedure ReleaseMouse; override;
{ Event processing methods }
@@ -1518,12 +1517,6 @@ begin
end;
-procedure TGDIWindow.PaintInvalidRegion;
-begin
- Windows.UpdateWindow(Handle);
-end;
-
-
procedure TGDIWindow.CaptureMouse;
begin
if FHasMouseCapture then
diff --git a/gfx/gfxbase.pas b/gfx/gfxbase.pas
index 4d9c2e90..69fcbedf 100644
--- a/gfx/gfxbase.pas
+++ b/gfx/gfxbase.pas
@@ -524,7 +524,6 @@ type
procedure SetMinMaxClientSize(const AMinSize, AMaxSize: TSize); virtual;
procedure Show; virtual; abstract;
procedure Invalidate; virtual; abstract;
- procedure PaintInvalidRegion; virtual; abstract;
procedure CaptureMouse; virtual; abstract;
procedure ReleaseMouse; virtual; abstract;
{ Event processing methods }
diff --git a/gfx/template/gfx_xxx.pas b/gfx/template/gfx_xxx.pas
index a9309c0f..257be415 100644
--- a/gfx/template/gfx_xxx.pas
+++ b/gfx/template/gfx_xxx.pas
@@ -128,19 +128,37 @@ type
procedure DoSetCursor; override;
function GetHandle: PtrUInt; override;
public
+ { Constructors / Destructors }
constructor Create(AParent: TFCustomWindow; AWindowOptions: TFWindowOptions); override;
destructor Destroy; override;
- procedure DefaultHandler(var Message); override;
+ { Widget controling methods }
procedure SetPosition(const APosition: TPoint); override;
procedure SetSize(const ASize: TSize); override;
procedure SetMinMaxSize(const AMinSize, AMaxSize: TSize); override;
procedure SetClientSize(const ASize: TSize); override;
procedure SetMinMaxClientSize(const AMinSize, AMaxSize: TSize); override;
procedure Show; override;
- procedure Invalidate(const ARect: TRect); override;
- procedure PaintInvalidRegion; override;
+ procedure Invalidate; override;
procedure CaptureMouse; override;
procedure ReleaseMouse; override;
+ { Event processing methods }
+ procedure EvCreate; override;
+ procedure EvFocusIn; override;
+ procedure EvFocusOut; override;
+ procedure EvHide; override;
+ procedure EvKeyPressed(AKey: Word); override;
+ procedure EvKeyReleased(AKey: Word); override;
+ procedure EvKeyChar(AKeyChar: Char); override;
+ procedure EvMouseEnter(const AMousePos: TPoint); override;
+ procedure EvMouseLeave; override;
+ procedure EvMousePressed(AButton: TMouseButton; const AMousePos: TPoint); override;
+ procedure EvMouseReleased(AButton: TMouseButton; const AMousePos: TPoint); override;
+ procedure EvMouseMove(const AMousePos: TPoint); override;
+ procedure EvMouseWheel(AWheelDelta: Single; const AMousePos: TPoint); override;
+ procedure EvPaint; override;
+ procedure EvMove; override;
+ procedure EvResize; override;
+ procedure EvShow; override;
end;
diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas
index 2d5d6c41..8ee0aa5d 100644
--- a/gfx/x11/gfx_x11.pas
+++ b/gfx/x11/gfx_x11.pas
@@ -198,14 +198,12 @@ type
TX11Application = class(TFCustomApplication)
private
- FDirtyList: TDirtyList;
FDefaultFont: TX11FontResourceImpl;
FEventFilter: TX11EventFilter;
Handle: PDisplay;
FWMProtocols: TAtom; // Atom for "WM_PROTOCOLS"
FWMDeleteWindow: TAtom; // Atom for "WM_DELETE_WINDOW"
FWMHints: TAtom; // Atom for "_MOTIF_WM_HINTS"
- property DirtyList: TDirtyList read FDirtyList;
function FindWindowByXID(XWindowID: X.TWindow): TFCustomWindow;
public
{ default methods }
@@ -231,7 +229,6 @@ type
FXEvent: PXEvent;
function StartComposing(const Event: TXEvent): TKeySym;
procedure EndComposing;
- procedure Expose(var Event: TXExposeEvent); message X.Expose;
procedure Configure(var Event: TXConfigureEvent); message X.ConfigureNotify;
procedure ClientMessage(var Event: TXClientMessageEvent); message X.ClientMessage;
protected
@@ -256,7 +253,6 @@ type
procedure SetMinMaxClientSize(const AMinSize, AMaxSize: TSize); override;
procedure Show; override;
procedure Invalidate; override;
- procedure PaintInvalidRegion; override;
procedure CaptureMouse; override;
procedure ReleaseMouse; override;
{ Event processing methods }
@@ -983,7 +979,6 @@ constructor TX11Application.Create;
begin
inherited Create;
- FDirtyList := TDirtyList.Create;
end;
@@ -997,8 +992,6 @@ begin
TFCustomWindow(Forms[i]).Free;
end;
- DirtyList.Free;
-
if Assigned(FDefaultFont) then
begin
FDefaultFont.Free;
@@ -1028,12 +1021,11 @@ begin
while (not (QuitWhenLastWindowCloses and (Forms.Count = 0))) and
(DoBreakRun = False) do
begin
- if Assigned(OnIdle) or Assigned(DirtyList.First) then
+ if Assigned(OnIdle) then
begin
if not XCheckMaskEvent(Handle, MaxInt, @XEvent) then
begin
- if Assigned(DirtyList.First) then DirtyList.PaintAll
- else if Assigned(OnIdle) then OnIdle(Self);
+ if Assigned(OnIdle) then OnIdle(Self);
continue;
end;
@@ -1389,8 +1381,6 @@ begin
if FCurCursorHandle <> 0 then
XFreeCursor(GFApplication.Handle, FCurCursorHandle);
- GFApplication.DirtyList.ClearQueueForWindow(Self);
-
GFApplication.RemoveWindow(Self);
XDestroyWindow(GFApplication.Handle, Handle);
@@ -1524,24 +1514,10 @@ begin
end;
procedure TX11Window.Invalidate;
-{var
- ARect: TRect;}
begin
-{ ARect.Left := Left;
- ARect.Top := Top;
- ARect.Right := Left + Width;
- ARect.Bottom := Top + Height;
-
- GFApplication.DirtyList.AddRect(Self, ARect); }
-
EvPaint();
end;
-procedure TX11Window.PaintInvalidRegion;
-begin
- GFApplication.DirtyList.PaintQueueForWindow(Self);
-end;
-
procedure TX11Window.CaptureMouse;
begin
XGrabPointer(GFApplication.Handle, Handle,
@@ -1912,38 +1888,6 @@ begin
OnKeyChar(Self, FComposeBuffer[i]);
end;
-procedure TX11Window.Expose(var Event: TXExposeEvent);
-{var
- IsNotEmpty: Boolean;
-begin
-WriteLn('Expose');
- if Assigned(OnPaint) then
- with Event do
- begin
- if not IsExposing then
- begin
- IsExposing := True;
- Canvas.SaveState;
- Canvas.EmptyClipRect;
- end;
- IsNotEmpty := Canvas.UnionClipRect(Rect(x, y, x + Width, y + Height));
- if Count = 0 then
- begin
- if IsNotEmpty then
- OnPaint(Self, Canvas.GetClipRect);
- IsExposing := False;
- Canvas.RestoreState;
- end;
- end;
-end;}
-var
- r: TRect;
-begin
- with Event do
- r := Rect(x, y, x + Width, y + Height);
- GFApplication.DirtyList.AddRect(Self, r);
-end;
-
procedure TX11Window.Configure(var Event: TXConfigureEvent);
begin
while XCheckTypedWindowEvent(GFApplication.Handle, Handle,