LCL-GTK3: Reduce compiler hints and notes.

git-svn-id: trunk@62258 -
This commit is contained in:
juha 2019-11-17 14:22:54 +00:00
parent 37a763ee4f
commit 8d9ae58846
2 changed files with 33 additions and 47 deletions

View File

@ -18,9 +18,6 @@ function TGtk3WidgetSet.CreateRubberBand(const ARect: TRect; const ABrush: HBrus
var
Widget: PGtkWidget absolute Result;
dx, dy: integer;
Pixmap: PGdkPixbuf;
gc: PCairo_t;
AColor: TGdkColor;
begin
dx := ARect.Right - ARect.Left;
dy := ARect.Bottom - ARect.Top;
@ -49,8 +46,8 @@ end;
procedure TGtk3WidgetSet.DrawDefaultDockImage(AOldRect, ANewRect: TRect;
AOperation: TDockImageOperation);
const
LineWidth = 2;
//const
// LineWidth = 2;
var
dx, dy: integer;
(*
@ -683,8 +680,8 @@ var
WorkImage, WorkMask: TGtk3Image;
R: TRect;
Width, Height: Integer;
InvertPixels: Boolean;
Px: Cardinal;
//InvertPixels: Boolean;
//Px: Cardinal;
begin
Result := false;
@ -848,17 +845,13 @@ function TGtk3WidgetSet.RawImage_FromDevice(out ARawImage: TRawImage; ADC: HDC;
const ARect: TRect): Boolean;
var
Desc: TRawImageDescription absolute ARawImage.Description;
//SrcWidth, SrcHeight: Integer;
WinID: Cardinal;
DCSize: TSize;
Pixmap: PGdkPixbuf;
Image: PGdkPixbuf;
Context: TGtk3DeviceContext;
DCOrigin: TPoint;
R: TRect;
Drawable: Pcairo_t;
AWindow: PGdkWindow;
//DCOrigin: TPoint;
//R: TRect;
//Drawable: Pcairo_t;
//AWindow: PGdkWindow;
procedure RawImage_FromImage(AImage: PGdkPixbuf);
var
@ -871,7 +864,6 @@ var
ARawImage.Mask := nil;
end;
begin
Result := True;
@ -1115,7 +1107,7 @@ var
X: Integer;
MainList,ChildList: PGList;
Title: String;
ActiveWindow: HWND;
//ActiveWindow: HWND;
BtnResult: LongInt;
n: Integer;
@ -1123,11 +1115,11 @@ var
const AImageHint: Integer = -1);
var
NewButton: PGtkWidget;
BitmapHandle, MaskHandle: HBitmap;
//BitmapHandle, MaskHandle: HBitmap;
// GDIObject: PGDIObject;
Pixbuf: PGdkPixbuf;
//Pixbuf: PGdkPixbuf;
// Mask: PGdkBitmap;
Img: PGtkWidget;
//Img: PGtkWidget;
begin
NewButton := gtk_dialog_add_button(Dialog,
@ -1319,8 +1311,6 @@ var
X: Integer;
MainList,ChildList: PGList;
Title: String;
ActiveWindow: HWND;
QuotedMessage: Pgchar;
n: Integer;
procedure CreateButton(const ALabel : String; const AResponse: Integer);
@ -1509,9 +1499,9 @@ end;
function TGtk3WidgetSet.AddEventHandler(AHandle: THandle; AFlags: dword;
AEventHandler: TWaitHandleEvent; AData: PtrInt): PEventHandler;
var
giochannel: pgiochannel;
// lEventHandler: PWaitHandleEventHandler;
//var
//giochannel: pgiochannel;
//lEventHandler: PWaitHandleEventHandler;
begin
Result := nil;
(*

View File

@ -397,8 +397,6 @@ end;
function TGtk3WidgetSet.CreateFontIndirectEx(const LogFont: TLogFont;
const LongFontName: string): HFONT;
var
ALogFontName: String;
begin
Result := HFONT(TGtk3Font.Create(LogFont, LongFontName));
end;
@ -1740,8 +1738,7 @@ begin
if AData <> nil then
begin
// DebugLn('TGtk3WidgetSet.GetActiveWindow found window from data ...',dbgsName(TGtk3Widget(AData).LCLObject));
Result := HWND(AData);
exit;
exit(HWND(AData));
end;
for i := 0 to Screen.FormCount - 1 do
begin
@ -1831,7 +1828,7 @@ function TGtk3WidgetSet.GetClipBox(DC: hDC; lpRect: PRect): Longint;
var
GtkDC: TGtk3DeviceContext absolute DC;
cr: Pcairo_t;
Pt: TPoint;
//Pt: TPoint;
ARect: TGdkRectangle;
begin
//{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
@ -2254,7 +2251,7 @@ var
aObject: TObject;
ALogFont: PLogFont absolute Buf;
ALogPen: PLogPen absolute Buf;
AExtLogPen: PExtLogPen absolute Buf;
//AExtLogPen: PExtLogPen absolute Buf;
ALogBrush: PLogBrush absolute Buf;
begin
Result := 0;
@ -2824,7 +2821,8 @@ end;
function TGtk3WidgetSet.GetWindowRect(Handle: hwnd; var ARect: TRect): Integer;
var
AWindow: PGdkWindow;
x, y, w, h: gint;
x, y: gint;
//w, h: gint;
GRect: TGdkRectangle;
Allocation: TGtkAllocation;
begin
@ -2835,8 +2833,8 @@ begin
if AWindow <> nil then
begin
AWindow^.get_origin(@x, @y);
w := AWindow^.get_width;
h := AWindow^.get_height;
//w := AWindow^.get_width;
//h := AWindow^.get_height;
AWindow^.get_frame_extents(@GRect);
// R := RectFromGdkRect(GRect);
ARect := Bounds(0, 0, GRect.width, GRect.Height);
@ -2894,10 +2892,9 @@ begin
end;
end;
function TGtk3WidgetSet.InvalidateRgn(Handle: HWND; Rgn: HRGN; Erase: Boolean
): Boolean;
var
R: TRect;
function TGtk3WidgetSet.InvalidateRgn(Handle: HWND; Rgn: HRGN; Erase: Boolean): Boolean;
//var
// R: TRect;
begin
Result := False; // inherited InvalidateRgn(Handle, Rgn, Erase);
if IsValidHandle(Handle) then
@ -2964,11 +2961,11 @@ end;
function TGtk3WidgetSet.LPtoDP(DC: HDC; var Points; Count: Integer): BOOL;
var
Matrix: cairo_matrix_t;
//Matrix: cairo_matrix_t;
cr: PCairo_t;
P: PPoint;
dx, dy: Double;
Pt: TPoint;
//Pt: TPoint;
begin
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
// DebugLn('WARNING: TGtk3WidgetSet.LPtoDP not implemented ...');
@ -3947,20 +3944,19 @@ function TGtk3WidgetSet.SetWindowOrgEx(dc: hdc; NewX, NewY: Integer;
OldPoint: PPoint): Boolean;
var
Matrix: cairo_matrix_t;
dx: Double;
dy: Double;
//dx, dy: Double;
begin
Result := False; // inherited SetWindowOrgEx(dc, NewX, NewY, OldPoint);
if IsValidDC(DC) then
begin
GetWindowOrgEx(dc, OldPoint);
cairo_get_matrix(TGtk3DeviceContext(DC).Widget, @Matrix);
dx := 0;
dy := 0;
//dx := 0;
//dy := 0;
// cairo_matrix_init_translate(Matrix, -NewX, -NewY);
cairo_matrix_translate(@Matrix,
-NewX - TGtk3DeviceContext(DC).fncOrigin.x,
-NewY - TGtk3DeviceContext(DC).fncOrigin.Y);
-NewY - TGtk3DeviceContext(DC).fncOrigin.Y);
cairo_transform(TGtk3DeviceContext(DC).Widget, @Matrix);
// cairo_set_matrix(TGtk3DeviceContext(DC).Widget, Matrix);
// DebugLn('TGtk3WidgetSet.SetWindowOrgEx NewX=',dbgs(NewX),' NewY=',dbgs(NewY));
@ -4000,7 +3996,7 @@ function TGtk3WidgetSet.ShowScrollBar(Handle: HWND; wBar: Integer;
var
AWidget: TGtk3Widget;
// AScrolledWin: PGtkScrolledWindow;
NewPolicy, OldPolicy: TGtkPolicyType;
NewPolicy: TGtkPolicyType;
begin
Result := IsValidHandle(Handle);
if not Result then
@ -4077,7 +4073,7 @@ var
DestContext: TGtk3DeviceContext absolute DestDC;
SrcContext: TGtk3DeviceContext absolute SrcDC;
ATargetRect, ASrcRect: TRect;
AImage: PGdkPixbuf;
//AImage: PGdkPixbuf;
begin
Result := False;
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}