Comments (12)
In this issue everything works for now.
Thank you
from graphics32.
You are using the FPC_GTK branch, right?
from graphics32.
Looking at the source for TLCLBackend I can see that Textout(X, Y, Text)
calls Canvas.TextOut
while Textout(DstRect, Flags, Text)
calls LCLIntf.DrawText
passing the canvas handle as a parameter:
graphics32/Source/GR32_Backends_LCL_Gtk.pas
Lines 390 to 399 in b001b62
graphics32/Source/GR32_Backends_LCL_Gtk.pas
Lines 411 to 419 in b001b62
The Canvas in the above is the TCanvas of an internally allocated TBitmap
.
When the canvas/bitmap is modified (e.g by drawing text on them) the TLCLBackend.FCanvasDirty
flag is set.
FCanvasDirty
is checked in TLCLBackend.NeedBits
. If FCanvasDirty
is set then CopyCanvasToPixmap
which copies pixel data from the canvas to the internal pixel buffer. NeedBits
is called when TBitmap32
needs access to the internal pixel buffer.
Anyway, this apparently works.
My guess is that the problem simply is that LCLIntf.ExtTextOut(Canvas.Handle, ...)
fails to call Changed
on the canvas; In TLCLBackend.Textout
and TLCLBackend.Textout
after the call to LCLIntf.ExtTextOut(...)
try adding a call to CanvasChanged
.
from graphics32.
I made some additional changes that should improve performance of text output on GTK (if it compiles at all :-) )
from graphics32.
Hi Anders.
I now have rebuild all with the latest FPC_GTK sources.
Here the results.
@FIRST The TextOut now works!
some minor bugs i corrected:
###############################################################################
GR32_Lazarus.lpk
###############################################################################
Compile:
GR32_Backends_LCL_Gtk.pas(404,5) Error: Wrong number of parameters specified for call to "TextOut"
comes from:
GR32_Backends_LCL_Gtk.pas(403): Canvas.TextOut(X, Y, FOwner.ClipRect, Text)
... here Canvas is of type Graphics.TCanvas, which ownes ...
procedure TextOut(X,Y: Integer; const Text: String); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
procedure TextRect(const ARect: TRect; X, Y: integer; const Text: string);
changed to:
GR32_Backends_LCL_Gtk.pas(403): Canvas.TextRect(FOwner.ClipRect, X, Y, Text)
GR32_Backends_LCL_Gtk.pas(456,19) Error: Wrong number of parameters specified for call to "Copy"
comes from:
GR32_Backends_LCL_Gtk.pas(456): TextCopy := Copy(Text) // string must be writable
... here System.Copy needs 1-based Index and Count
changed to:
GR32_Backends_LCL_Gtk.pas(456): TextCopy := Copy(Text, 1, Length(Text))
GR32_Backends_LCL_Gtk.pas(516,11) Error: Identifier not found "PGtkWidget"
comes from:
GR32_Backends_LCL_Gtk.pas(44): gdk2, gdk2pixbuf, glib2, gtk2Def,
GR32_Backends_LCL_Gtk.pas(516): Widget: PGtkWidget;
... here PGtkWidget definition ist included in gtk2 unit
changed to:
GR32_Backends_LCL_Gtk.pas(44): gdk2, gdk2pixbuf, glib2, gtk2Def, gtk2
GR32_Backends_LCL_Gtk.pas(567,32) Error: Wrong number of parameters specified for call to "Max"
comes from:
GR32_Backends_LCL_Gtk.pas(567): AUpdateRects.Capacity := Max(AUpdateRects.Capacity, AUpdateRects.Count + AReservedCapacity + Count);
... here GR32_Lazarus.Max needs 3 parameters function Max(A,B,C:Integer):Integer;
changed to:
GR32_Backends_LCL_Gtk.pas(567): AUpdateRects.Capacity := Max(AUpdateRects.Capacity, AUpdateRects.Capacity, AUpdateRects.Count + AReservedCapacity + Count);
GR32.ImageFormats.TPicture.pas(127,32) Error: No matching implementation for interface method "LoadFromClipboardFormat(TCustomBitmap32;QWord;THandle;THandle):Boolean;" found
comes from
GR32.ImageFormats.TPicture.pas(42): {$ifdef FPC}
GR32.ImageFormats.TPicture.pas(43): LCLType,
GR32.ImageFormats.TPicture.pas(44): {$endif FPC}
GR32.ImageFormats.TPicture.pas(44): Classes,
GR32.ImageFormats.TPicture.pas(130): IImageFormatClipboardFormat)
GR32.ImageFormats.TPicture.pas(142): function LoadFromClipboardFormat(ADest: TCustomBitmap32; AFormat: TClipboardFormat; AData: THandle; APalette: THandle): boolean;
GR32.ImageFormats.TPicture.pas(227): function TImageFormatReaderTPicture.LoadFromClipboardFormat(ADest: TCustomBitmap32; AFormat: TClipboardFormat; AData: THandle; APalette: THandle): boolean;
... after many trys if found that LCLType has to be included behind Classes (like it is done for example in GR32.ImageFormats.TBitmap.pas )
changed to:
GR32.ImageFormats.TPicture.pas(42): Classes,
GR32.ImageFormats.TPicture.pas(43): {$ifdef FPC}
GR32.ImageFormats.TPicture.pas(44): LCLType,
GR32.ImageFormats.TPicture.pas(44): {$endif FPC}
Compile package GR32_Lazarus 2.0: Success, Hints: 2
Hint: Start of reading config file /home/hb/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg
Hint: End of reading config file /home/hb/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg
Verbose: Free Pascal Compiler version 3.2.2-r0d122c49 [2024/03/29] for x86_64
Verbose: Copyright (c) 1993-2021 by Florian Klaempfl and others
Verbose: Target OS: Linux for x86-64
Verbose: Compiling GR32_Lazarus.pas
Verbose: 23 lines compiled, 1.3 sec
Verbose: 2 hint(s) issued
###############################################################################
GR32_DSGN_Lazarus.lpk
###############################################################################
Compile:
Messages, Warnings: 2
Warning: other unit files search path (aka unit path) of "GR32_Lazarus 2.0" contains "/home/hb/Entwicklung/graphics32/Source", which belongs to package "GR32_DSGN_Lazarus"
Warning: other unit files search path (aka unit path) of "GR32_DSGN_Lazarus 2.0" contains "/home/hb/Entwicklung/graphics32/Source", which belongs to package "GR32_Lazarus"
Compile package GR32_DSGN_Lazarus 2.0: Success, Hints: 2
Hint: Start of reading config file /home/hb/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg
Hint: End of reading config file /home/hb/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg
Verbose: Free Pascal Compiler version 3.2.2-r0d122c49 [2024/03/29] for x86_64
Verbose: Copyright (c) 1993-2021 by Florian Klaempfl and others
Verbose: Target OS: Linux for x86-64
Verbose: Compiling GR32_DSGN_Lazarus.pas
GR32_DSGN_Lazarus.pas(10,13) Verbose: Unit "GR32_Dsgn_Misc" not used in GR32_DSGN_Lazarus
GR32_DSGN_Lazarus.pas(10,46) Verbose: Unit "GR32_Dsgn_Bitmap" not used in GR32_DSGN_Lazarus
Verbose: 22 lines compiled, 1.5 sec
Verbose: 4 hint(s) issued
Lazarus rebuilds without any errors.
Thank You.
We can Close this issue.
Hannes
from graphics32.
I'll close it when I have applied your changes :-)
from graphics32.
I have adapted your changes. If it still works (please test) then I will merge the branch and close the issue.
from graphics32.
1.try:
... Uninstall all GR32 stuff
... Compile package GR32_Lazarus 2.0: Success, Warnings: 57, Hints: 850
... Compile package GR32_DSGN_Lazarus 2.0: Success, Warnings: 9, Hints: 775
... Install (Rebuild Lazarus)
failed: GR32_Blend.pas(85,12) Error: Can't find unit GR32_Blend used by GR32
2.try:
... Uninstall all GR32 stuff
... Compile package GR32_DSGN_Lazarus 2.0: Success, Warnings: 8, Hints: 589
... Install (Rebuild Lazarus)
Success
GR32_Blend is still causing a problem
Did you understand why Classes has to be included before LCLType?
Greetings
from graphics32.
GR32_Blend is still causing a problem
Yes: #297
While the FPC_GTK branch design-time package can be installed right now, once it's merged into the master branch it will no longer be possible until #297 is fixed.
Did you understand why Classes has to be included before LCLType?
Yes; The declaration of THandle
in Classes
(via System
) is incompatible with the declarations in LCLType
. Why do you ask?
from graphics32.
Yes, I hadn't seen that
from graphics32.
Okay, so if there's no further changes required in this issue I will merge and close it.
from graphics32.
Thanks for the help with getting this working
from graphics32.
Related Issues (20)
- Repaint Optimizer "forgets" to update the bitmap HOT 2
- Repaint Optimizer "forgets" to update the bitmap 2 HOT 7
- Polygon grow using Clipper2 very very slow HOT 43
- Delphi 12 incompatibility HOT 1
- Polygon draw result looks strange HOT 18
- GR32_LowLevel.Mirror PUREPASCAL does not produce expected values HOT 11
- Revive jsRoundEx? HOT 1
- Lazarus design time support broken HOT 21
- PNG support broken on 32-bit FPC HOT 4
- LF Line Endings in the .DPKs Cause File Corruption HOT 18
- Access Violation with color picker controls on Lazarus HOT 2
- BuildPolyLine produces concave curves that are unsuitable for polylines HOT 13
- TColorPickerGTK not displayed correctely after copy/paste HOT 4
- NeoLemmix / SuperLemmix pull request
- Commit "Fix for AV with tiled draw" breaks my code HOT 7
- Bug with layes visibility change HOT 15
- Repaint TCustomLayer and draw TBitmapLayer at the same time HOT 13
- TGaussianKernel is broken HOT 1
- GAMMA_ENCODING_TABLE mayhem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphics32.