mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 22:58:14 +02:00
Qt: renamed TQtImage Handle: QImageH to FHandle: QImageH.
git-svn-id: trunk@33287 -
This commit is contained in:
parent
4217128215
commit
da01ce8458
@ -672,11 +672,11 @@ begin
|
||||
end
|
||||
else begin
|
||||
WorkImage := TQtImage.Create;
|
||||
WorkImage.CopyFrom(Image.Handle, R.Left, R.Top, Width, Height);
|
||||
WorkImage.CopyFrom(Image.FHandle, R.Left, R.Top, Width, Height);
|
||||
if Mask <> nil then
|
||||
begin
|
||||
WorkMask := TQtImage.Create;
|
||||
WorkMask.CopyFrom(Mask.Handle, R.Left, R.Top, Width, Height);
|
||||
WorkMask.CopyFrom(Mask.FHandle, R.Left, R.Top, Width, Height);
|
||||
end
|
||||
else
|
||||
WorkMask := nil;
|
||||
@ -703,13 +703,13 @@ begin
|
||||
InvertPixels := False;
|
||||
if WorkImage <> nil then
|
||||
begin
|
||||
Px := QImage_pixel(WorkImage.Handle, 0, 0);
|
||||
Px := QImage_pixel(WorkImage.FHandle, 0, 0);
|
||||
InvertPixels :=
|
||||
not QImage_hasAlphaChannel(WorkMask.Handle) and
|
||||
not QImage_hasAlphaChannel(WorkImage.Handle) and
|
||||
not QImage_hasAlphaChannel(WorkMask.FHandle) and
|
||||
not QImage_hasAlphaChannel(WorkImage.FHandle) and
|
||||
// invert only if WorkImage is RGB32 fmt and allGray
|
||||
(WorkImage.getFormat = QImageFormat_RGB32) and
|
||||
QImage_allGray(WorkImage.Handle) and
|
||||
QImage_allGray(WorkImage.FHandle) and
|
||||
((Px = 0) or (Px = $FF))
|
||||
end;
|
||||
if InvertPixels then
|
||||
@ -804,7 +804,7 @@ begin
|
||||
end else
|
||||
begin
|
||||
if Context.vImage <> nil then
|
||||
RawImage_FromImage(Context.vImage.Handle)
|
||||
RawImage_FromImage(Context.vImage.FHandle)
|
||||
else
|
||||
if Context.ParentPixmap <> nil then
|
||||
begin
|
||||
|
@ -633,7 +633,7 @@ begin
|
||||
|
||||
if (TQtDeviceContext(CanvasHandle).vImage <> nil) then
|
||||
begin
|
||||
Color := QColor_create(QImage_pixel(TQtDeviceContext(CanvasHandle).vImage.Handle, X, Y));
|
||||
Color := QColor_create(QImage_pixel(TQtDeviceContext(CanvasHandle).vImage.FHandle, X, Y));
|
||||
Result := RGBToColor(QColor_red(Color), QColor_green(Color), QColor_blue(Color));
|
||||
QColor_destroy(Color);
|
||||
end;
|
||||
|
@ -140,7 +140,7 @@ type
|
||||
FData: PByte;
|
||||
FDataOwner: Boolean;
|
||||
public
|
||||
Handle: QImageH;
|
||||
FHandle: QImageH;
|
||||
public
|
||||
constructor Create;
|
||||
constructor Create(vHandle: QImageH); overload;
|
||||
@ -1229,7 +1229,7 @@ end;
|
||||
|
||||
constructor TQtImage.Create;
|
||||
begin
|
||||
Handle := QImage_create();
|
||||
FHandle := QImage_create();
|
||||
FData := nil;
|
||||
FDataOwner := False;
|
||||
end;
|
||||
@ -1241,7 +1241,7 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
constructor TQtImage.Create(vHandle: QImageH);
|
||||
begin
|
||||
Handle := vHandle;
|
||||
FHandle := vHandle;
|
||||
FData := nil;
|
||||
FDataOwner := False;
|
||||
end;
|
||||
@ -1259,11 +1259,11 @@ begin
|
||||
|
||||
if FData = nil then
|
||||
begin
|
||||
Handle := QImage_create(width, height, format);
|
||||
QImage_fill(Handle, 0);
|
||||
FHandle := QImage_create(width, height, format);
|
||||
QImage_fill(FHandle, 0);
|
||||
end
|
||||
else
|
||||
Handle := QImage_create(FData, width, height, format);
|
||||
FHandle := QImage_create(FData, width, height, format);
|
||||
end;
|
||||
|
||||
constructor TQtImage.Create(AData: PByte; width: Integer; height: Integer;
|
||||
@ -1273,9 +1273,9 @@ begin
|
||||
FDataOwner := ADataOwner;
|
||||
|
||||
if FData = nil then
|
||||
Handle := QImage_create(width, height, format)
|
||||
FHandle := QImage_create(width, height, format)
|
||||
else
|
||||
Handle := QImage_create(FData, width, height, bytesPerLine, format);
|
||||
FHandle := QImage_create(FData, width, height, bytesPerLine, format);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1291,8 +1291,8 @@ begin
|
||||
WriteLn('TQtImage.Destroy Handle:', dbgs(Handle));
|
||||
{$endif}
|
||||
|
||||
if Handle <> nil then
|
||||
QImage_destroy(Handle);
|
||||
if FHandle <> nil then
|
||||
QImage_destroy(FHandle);
|
||||
if (FDataOwner) and (FData <> nil) then
|
||||
FreeMem(FData);
|
||||
|
||||
@ -1313,18 +1313,18 @@ end;
|
||||
function TQtImage.AsPixmap(flags: QtImageConversionFlags = QtAutoColor): QPixmapH;
|
||||
begin
|
||||
Result := QPixmap_create();
|
||||
QPixmap_fromImage(Result, Handle, flags);
|
||||
QPixmap_fromImage(Result, FHandle, flags);
|
||||
end;
|
||||
|
||||
function TQtImage.AsBitmap(flags: QtImageConversionFlags = QtAutoColor): QBitmapH;
|
||||
begin
|
||||
Result := QBitmap_create();
|
||||
QBitmap_fromImage(Result, Handle, flags);
|
||||
QBitmap_fromImage(Result, FHandle, flags);
|
||||
end;
|
||||
|
||||
procedure TQtImage.CopyFrom(AImage: QImageH; x, y, w, h: integer);
|
||||
begin
|
||||
QImage_copy(AImage, Handle, x, y, w, h);
|
||||
QImage_copy(AImage, FHandle, x, y, w, h);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1334,7 +1334,7 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtImage.height: Integer;
|
||||
begin
|
||||
Result := QImage_height(Handle);
|
||||
Result := QImage_height(FHandle);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1344,22 +1344,22 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtImage.width: Integer;
|
||||
begin
|
||||
Result := QImage_width(Handle);
|
||||
Result := QImage_width(FHandle);
|
||||
end;
|
||||
|
||||
function TQtImage.depth: Integer;
|
||||
begin
|
||||
Result := QImage_depth(Handle);
|
||||
Result := QImage_depth(FHandle);
|
||||
end;
|
||||
|
||||
function TQtImage.dotsPerMeterX: Integer;
|
||||
begin
|
||||
Result := QImage_dotsPerMeterX(Handle);
|
||||
Result := QImage_dotsPerMeterX(FHandle);
|
||||
end;
|
||||
|
||||
function TQtImage.dotsPerMeterY: Integer;
|
||||
begin
|
||||
Result := QImage_dotsPerMeterY(Handle);
|
||||
Result := QImage_dotsPerMeterY(FHandle);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1369,7 +1369,7 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtImage.bits: PByte;
|
||||
begin
|
||||
Result := QImage_bits(Handle);
|
||||
Result := QImage_bits(FHandle);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1379,22 +1379,22 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtImage.numBytes: Integer;
|
||||
begin
|
||||
Result := QImage_numBytes(Handle);
|
||||
Result := QImage_numBytes(FHandle);
|
||||
end;
|
||||
|
||||
function TQtImage.bytesPerLine: Integer;
|
||||
begin
|
||||
Result := QImage_bytesPerLine(Handle);
|
||||
Result := QImage_bytesPerLine(FHandle);
|
||||
end;
|
||||
|
||||
procedure TQtImage.invertPixels(InvertMode: QImageInvertMode = QImageInvertRgb);
|
||||
begin
|
||||
QImage_invertPixels(Handle, InvertMode);
|
||||
QImage_invertPixels(FHandle, InvertMode);
|
||||
end;
|
||||
|
||||
function TQtImage.getFormat: QImageFormat;
|
||||
begin
|
||||
Result := QImage_format(Handle);
|
||||
Result := QImage_format(FHandle);
|
||||
end;
|
||||
|
||||
{ TQtFont }
|
||||
@ -2313,7 +2313,7 @@ begin
|
||||
|
||||
QPainter_destroy(Widget);
|
||||
|
||||
Widget := QPainter_Create(vImage.Handle);
|
||||
Widget := QPainter_Create(vImage.FHandle);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -450,7 +450,7 @@ begin
|
||||
BS_PATTERN, // Pattern brush defined by a memory bitmap.
|
||||
BS_PATTERN8X8: // Same as BS_PATTERN.
|
||||
begin
|
||||
QtBrush.setTextureImage(TQtImage(LogBrush.lbHatch).Handle);
|
||||
QtBrush.setTextureImage(TQtImage(LogBrush.lbHatch).FHandle);
|
||||
QtBrush.Style := QtTexturePattern;
|
||||
end;
|
||||
else
|
||||
@ -622,11 +622,11 @@ begin
|
||||
if IsValidGDIObject(IconInfo^.hbmColor) then
|
||||
begin
|
||||
APixmap := QPixmap_create();
|
||||
QPixmap_fromImage(APixmap, TQtImage(IconInfo^.hbmColor).Handle);
|
||||
QPixmap_fromImage(APixmap, TQtImage(IconInfo^.hbmColor).FHandle);
|
||||
if IconInfo^.hbmMask <> 0 then
|
||||
begin
|
||||
ATemp := QPixmap_create();
|
||||
QPixmap_fromImage(ATemp, TQtImage(IconInfo^.hbmMask).Handle);
|
||||
QPixmap_fromImage(ATemp, TQtImage(IconInfo^.hbmMask).FHandle);
|
||||
AMask := QBitmap_create(ATemp);
|
||||
QPixmap_setMask(APixmap, AMask);
|
||||
QPixmap_destroy(ATemp);
|
||||
@ -661,7 +661,7 @@ begin
|
||||
if ABitmap = 0 then
|
||||
exit;
|
||||
QtBrush := TQtBrush.Create(True);
|
||||
Image := QImage_create(TQtImage(ABitmap).Handle);
|
||||
Image := QImage_create(TQtImage(ABitmap).FHandle);
|
||||
try
|
||||
QtBrush.setTextureImage(Image);
|
||||
finally
|
||||
@ -860,7 +860,7 @@ begin
|
||||
|
||||
// we must stop paintdevice before destroying
|
||||
|
||||
APaintEngine := QImage_paintEngine(TQtImage(AObject).Handle);
|
||||
APaintEngine := QImage_paintEngine(TQtImage(AObject).FHandle);
|
||||
|
||||
if (APaintEngine <> nil) and QPaintEngine_isActive(APaintEngine) then
|
||||
begin
|
||||
@ -2424,7 +2424,7 @@ begin
|
||||
if (Bitmap = 0) or (Count <= 0) then
|
||||
Exit;
|
||||
|
||||
Image := QImage_create(TQtImage(Bitmap).Handle);
|
||||
Image := QImage_create(TQtImage(Bitmap).FHandle);
|
||||
try
|
||||
Result := (QImage_width(Image) * QImage_height(Image) * QImage_depth(Image) + 7) div 8;
|
||||
if Count < Result then
|
||||
@ -6264,7 +6264,7 @@ begin
|
||||
Exit;
|
||||
end
|
||||
else
|
||||
Image := SrcQDC.vImage.Handle;
|
||||
Image := SrcQDC.vImage.FHandle;
|
||||
|
||||
QTransform_map(SrcMatrix, XSrc, YSrc, @XSrc, @YSrc);
|
||||
// our map can have some transformations
|
||||
@ -6306,7 +6306,7 @@ begin
|
||||
//DstQDC.CorrectCoordinates(SrcRect);
|
||||
//DstQDC.CorrectCoordinates(MaskRect);
|
||||
if Mask <> 0 then
|
||||
QMask := TQtImage(Mask).Handle
|
||||
QMask := TQtImage(Mask).FHandle
|
||||
else
|
||||
QMask := nil;
|
||||
|
||||
|
@ -98,7 +98,7 @@ begin
|
||||
begin
|
||||
AValue.GetImageIndexAndEffect(IconModeToButtonState[Mode], AIndex, AEffect);
|
||||
AValue.Images.GetBitmap(AIndex, AGlyph, AEffect);
|
||||
QPixmap_fromImage(APixmap, TQtImage(AGlyph.Handle).Handle);
|
||||
QPixmap_fromImage(APixmap, TQtImage(AGlyph.Handle).FHandle);
|
||||
QIcon_addPixmap(AIcon, APixmap, Mode, QIconOn);
|
||||
end;
|
||||
QPixmap_destroy(APixmap);
|
||||
|
@ -667,7 +667,8 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
|
||||
Result := TQtWidgetset(Widgetset).DragImageList_BeginDrag(TQtImage(ABitmap.Handle).Handle, ADragImageList.DragHotSpot);
|
||||
Result := TQtWidgetset(Widgetset).DragImageList_BeginDrag(
|
||||
TQtImage(ABitmap.Handle).FHandle, ADragImageList.DragHotSpot);
|
||||
if Result then
|
||||
TQtWidgetset(Widgetset).DragImageList_DragMove(X, Y);
|
||||
ABitmap.Free;
|
||||
@ -708,7 +709,8 @@ begin
|
||||
end else
|
||||
begin
|
||||
TQtWidgetset(Widgetset).DragImageLock := True;
|
||||
Result := TQtWidgetset(Widgetset).DragImageList_DragMove(X, Y) and TQtWidgetset(Widgetset).DragImageList_SetVisible(True);
|
||||
Result := TQtWidgetset(Widgetset).DragImageList_DragMove(X, Y) and
|
||||
TQtWidgetset(Widgetset).DragImageList_SetVisible(True);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user