View Issue Details

IDProjectCategoryView StatusLast Update
0035697PatchesWidgetsetpublic2019-06-13 11:39
ReporterAlexey Tor.Assigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionreopened 
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0035697: Gtk3: fix font angle truncated to int
Description- fix font Orientation angle truncated to int (like it was fixed for gtk2). You cannot test it coz Orientation is not rendered.
- add "const" for string params.
TagsNo tags attached.
Fixed in Revisionr61347
LazTarget-
WidgetsetGTK 3
Attached Files
  • gtk3fix.diff (3,934 bytes)
    Index: lcl/interfaces/gtk3/gtk3objects.pas
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3objects.pas	(revision 61344)
    +++ lcl/interfaces/gtk3/gtk3objects.pas	(working copy)
    @@ -59,10 +59,10 @@
         FLogFont: TLogFont;
         FFontName: String;
         FHandle: PPangoFontDescription;
    -    procedure SetFontName(AValue: String);
    +    procedure SetFontName(const AValue: String);
       public
         constructor Create(ACairo: Pcairo_t; AWidget: PGtkWidget = nil);
    -    constructor Create(ALogFont: TLogFont; ALongFontName: String);
    +    constructor Create(ALogFont: TLogFont; const ALongFontName: String);
         destructor Destroy; override;
         property FontName: String read FFontName write SetFontName;
         property Handle: PPangoFontDescription read FHandle;
    @@ -230,8 +230,8 @@
         procedure drawPoint(x1: Integer; y1: Integer);
         procedure drawRect(x1: Integer; y1: Integer; w: Integer; h: Integer; const AFill: Boolean);
         procedure drawRoundRect(x, y, w, h, rx, ry: Integer);
    -    procedure drawText(x: Integer; y: Integer; s: String); overload;
    -    procedure drawText(x,y,w,h,flags: Integer; s: String); overload;
    +    procedure drawText(x: Integer; y: Integer; const s: String); overload;
    +    procedure drawText(x,y,w,h,flags: Integer; const s: String); overload;
         procedure drawLine(x1: Integer; y1: Integer; x2: Integer; y2: Integer);
         procedure drawEllipse(x: Integer; y: Integer; w: Integer; h: Integer);
         procedure drawSurface(targetRect: PRect; Surface: Pcairo_surface_t; sourceRect: PRect;
    @@ -282,7 +282,7 @@
       end;
     
     function CheckBitmap(const ABitmap: HBITMAP; const AMethodName: String;
    -  AParamName: String = ''): Boolean;
    +  const AParamName: String = ''): Boolean;
     procedure Gtk3WordWrap(DC: HDC; AText: PChar;
       MaxWidthInPixel: integer; out Lines: PPChar; out LineCount: integer);
     
    @@ -324,7 +324,7 @@
       Returns: If the bitmap is valid
      ------------------------------------------------------------------------------}
     function CheckBitmap(const ABitmap: HBITMAP; const AMethodName: String;
    -  AParamName: String): Boolean;
    +  const AParamName: String): Boolean;
     begin
       Result := TObject(ABitmap) is TGtk3Image;
       if Result then Exit;
    @@ -419,7 +419,7 @@
     
     { TGtk3Font }
     
    -procedure TGtk3Font.SetFontName(AValue: String);
    +procedure TGtk3Font.SetFontName(const AValue: String);
     begin
       if FFontName=AValue then Exit;
       FFontName:=AValue;
    @@ -461,7 +461,7 @@
       // writeln('TGtk3Font.Create1 ',FFontName);
     end;
     
    -constructor TGtk3Font.Create(ALogFont: TLogFont; ALongFontName: String);
    +constructor TGtk3Font.Create(ALogFont: TLogFont; const ALongFontName: String);
     var
       AContext: PPangoContext;
       ADescription: PPangoFontDescription;
    @@ -1280,7 +1280,7 @@
       RoundRect(x, y, w, h, rx, ry);
     end;
     
    -procedure TGtk3DeviceContext.drawText(x: Integer; y: Integer; s: String);
    +procedure TGtk3DeviceContext.drawText(x: Integer; y: Integer; const s: String);
     var
       e: cairo_font_extents_t;
       R: Double;
    @@ -1312,7 +1312,7 @@
       end;
     end;
     
    -procedure TGtk3DeviceContext.drawText(x, y, w, h, flags: Integer; s: String
    +procedure TGtk3DeviceContext.drawText(x, y, w, h, flags: Integer; const s: String
       );
     var
       e: cairo_font_extents_t;
    Index: lcl/interfaces/gtk3/gtk3winapi.inc
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3winapi.inc	(revision 61344)
    +++ lcl/interfaces/gtk3/gtk3winapi.inc	(working copy)
    @@ -788,7 +788,7 @@
         var TextLeft,TextTop: Integer);
       var
         OffsX, OffsY: integer;
    -    Angle: Integer;
    +    Angle: Double;
         Size: TSize;
         R: TRect;
       begin
    @@ -795,9 +795,9 @@
         R := SavedRect;
         OffsX := R.Right - R.Left;
         OffsY := R.Bottom - R.Top;
    -    Size.cX := OffsX;
    +    Size.cx := OffsX;
         Size.cy := OffsY;
    -    Angle := AFontAngle div 10;
    +    Angle := AFontAngle / 10;
         if Angle < 0 then
           Angle := 360 + Angle;
     
    
    gtk3fix.diff (3,934 bytes)
  • str.diff (10,286 bytes)
    Index: lcl/interfaces/gtk2/gtk2trayicon.inc
    ===================================================================
    --- lcl/interfaces/gtk2/gtk2trayicon.inc	(revision 61348)
    +++ lcl/interfaces/gtk2/gtk2trayicon.inc	(working copy)
    @@ -45,7 +45,7 @@
         destructor Destroy; override;
         procedure Show;
         function GetPosition: TPoint;
    -    procedure Update(NewPixBuf: PGdkPixbuf; NewHint: String);
    +    procedure Update(NewPixBuf: PGdkPixbuf; const NewHint: String);
       end;
     
     const
    @@ -479,7 +479,7 @@
       end;
     end;
     
    -procedure TGtk2TrayIconHandle.Update(NewPixBuf: PGdkPixbuf; NewHint: String);
    +procedure TGtk2TrayIconHandle.Update(NewPixBuf: PGdkPixbuf; const NewHint: String);
     begin
     {$ifdef UseStatusIcon}
       if FStatusIcon <> nil then
    Index: lcl/interfaces/gtk3/gtk3widgets.pas
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3widgets.pas	(revision 61348)
    +++ lcl/interfaces/gtk3/gtk3widgets.pas	(working copy)
    @@ -94,7 +94,7 @@
         function _Release: LongInt; {$IFDEF WINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
         function EatArrowKeys(const AKey: Word): Boolean; virtual;
         function getText: String; virtual;
    -    procedure setText(AValue: String); virtual;
    +    procedure setText(const AValue: String); virtual;
         function GetContext: HDC; virtual;
         function CreateWidget(const Params: TCreateParams):PGtkWidget; virtual;
         procedure DestroyWidget; virtual;
    @@ -209,7 +209,7 @@
       protected
         function EatArrowKeys(const AKey: Word): Boolean; override;
         function getText: String; override;
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
       public
         procedure InitializeWidget; override;
    @@ -331,7 +331,7 @@
         procedure SetStaticBorderStyle(AValue: TStaticBorderStyle);
       protected
         function getText: String; override;
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
       public
         property Alignment: TAlignment read GetAlignment write SetAlignment;
    @@ -351,7 +351,7 @@
       private
         FPageLabel: PGtkLabel;
       protected
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
         function getText: String; override;
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
         procedure DestroyWidget; override;
    @@ -373,7 +373,7 @@
         procedure SetPageIndex(AIndex: Integer);
         procedure SetShowTabs(const AShowTabs: Boolean);
         procedure SetTabPosition(const ATabPosition: TTabPosition);
    -    procedure SetTabLabelText(AChild: TCustomPage; AText: String);
    +    procedure SetTabLabelText(AChild: TCustomPage; const AText: String);
         function  GetTabLabelText(AChild: TCustomPage): String;
       end;
     
    @@ -431,7 +431,7 @@
       TGtk3MenuItem = class(TGtk3Bin)
       private
         function GetCaption: string;
    -    procedure SetCaption(AValue: string);
    +    procedure SetCaption(const AValue: string);
       protected
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
       public
    @@ -487,7 +487,7 @@
         procedure SetWordWrap(AValue: Boolean);
       protected
         function getText: String; override;
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
         function EatArrowKeys(const AKey: Word): Boolean; override;
       public
    @@ -605,7 +605,7 @@
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
         procedure DoBeforeLCLPaint; override;
         function getText: String; override;
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
       public
         property BevelInner: TBevelCut read FBevelInner write FBevelInner;
         property BevelOuter: TBevelCut read FBevelOuter write FBevelOuter;
    @@ -618,7 +618,7 @@
       protected
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
         function getText: String; override;
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
       public
       end;
     
    @@ -635,9 +635,9 @@
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
         function EatArrowKeys(const AKey: Word): Boolean; override;
         function getText: String; override;
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
       public
    -    procedure DumpPrivateStructValues(ADbgEvent: String);
    +    procedure DumpPrivateStructValues(const ADbgEvent: String);
       public
         function CanFocus: Boolean; override;
         procedure SetFocus; override;
    @@ -664,7 +664,7 @@
         procedure SetSpacing(AValue: Integer);
       protected
         function getText: String; override;
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
       public
         function IsWidgetOk: Boolean; override;
    @@ -746,12 +746,12 @@
         function GetTitle: String;
         procedure SetIcon(AValue: PGdkPixBuf);
         procedure SetSkipTaskBarHint(AValue: Boolean);
    -    procedure SetTitle(AValue: String);
    +    procedure SetTitle(const AValue: String);
       protected
         function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
         function EatArrowKeys(const AKey: Word): Boolean; override;
         function getText: String; override;
    -    procedure setText(AValue: String); override;
    +    procedure setText(const AValue: String); override;
       public
         // function getClientBounds: TRect; override;
         function getClientRect: TRect; override;
    @@ -779,7 +779,7 @@
           FText: String;
         protected
           function getText: String; override;
    -      procedure setText(AValue: String); override;
    +      procedure setText(const AValue: String); override;
           function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
       end;
     
    @@ -2475,7 +2475,7 @@
       Result := '';
     end;
     
    -procedure TGtk3Widget.setText(AValue: String);
    +procedure TGtk3Widget.setText(const AValue: String);
     begin
       // DebugLn('WARNING: ',dbgsName(LCLObject),' self=',dbgsName(Self),' does not implement setText !');
     end;
    @@ -3067,7 +3067,7 @@
       Result := FText;
     end;
     
    -procedure TGtk3Panel.setText(AValue: String);
    +procedure TGtk3Panel.setText(const AValue: String);
     begin
       if FText = AValue then
         exit;
    @@ -3101,7 +3101,7 @@
       end;
     end;
     
    -procedure TGtk3GroupBox.setText(AValue: String);
    +procedure TGtk3GroupBox.setText(const AValue: String);
     begin
       if IsWidgetOK then
       begin
    @@ -3311,7 +3311,7 @@
         Result := '';
     end;
     
    -procedure TGtk3Entry.setText(AValue: String);
    +procedure TGtk3Entry.setText(const AValue: String);
     begin
       if IsValidHandle and IsWidgetOK then
         PGtkEntry(Widget)^.set_text(PgChar(AValue));
    @@ -3731,7 +3731,7 @@
         Result := PGtkLabel(getContainerWidget)^.get_text;
     end;
     
    -procedure TGtk3StaticText.setText(AValue: String);
    +procedure TGtk3StaticText.setText(const AValue: String);
     begin
       if IsWidgetOk then
         PGtkLabel(getContainerWidget)^.set_text(PgChar(AValue));
    @@ -3961,7 +3961,7 @@
     
     { TGtk3Page }
     
    -procedure TGtk3Page.setText(AValue: String);
    +procedure TGtk3Page.setText(const AValue: String);
     begin
       if Assigned(FPageLabel) then
         FPageLabel^.set_text(PChar(AValue));
    @@ -4271,7 +4271,7 @@
         PGtkNoteBook(GetContainerWidget)^.set_tab_pos(GtkPositionTypeMap[ATabPosition]);
     end;
     
    -procedure TGtk3NoteBook.SetTabLabelText(AChild: TCustomPage; AText: String);
    +procedure TGtk3NoteBook.SetTabLabelText(AChild: TCustomPage; const AText: String);
     begin
       if IsWidgetOK then
         TGtk3Widget(AChild.Handle).setText(AText);
    @@ -4362,7 +4362,7 @@
         Result := PGtkMenuItem(FWidget)^.get_label;
     end;
     
    -procedure TGtk3MenuItem.SetCaption(AValue: string);
    +procedure TGtk3MenuItem.SetCaption(const AValue: string);
     begin
       if IsWidgetOK then
         PGtkMenuItem(FWidget)^.set_label(PgChar(AValue));
    @@ -4782,7 +4782,7 @@
       // DebugLn('TGtk3Memo.getText Result=',Result);
     end;
     
    -procedure TGtk3Memo.setText(AValue: String);
    +procedure TGtk3Memo.setText(const AValue: String);
     var
       ABuffer: PGtkTextBuffer;
       AIter: PGtkTextIter;
    @@ -6011,13 +6011,13 @@
         Result := StrPas(PGtkComboBox(GetContainerWidget)^.get_title);
     end;
     
    -procedure TGtk3ComboBox.setText(AValue: String);
    +procedure TGtk3ComboBox.setText(const AValue: String);
     begin
       if Gtk3IsComboBox(FWidget) then
         PGtkComboBox(GetContainerWidget)^.set_title(PgChar(AValue));
     end;
     
    -procedure TGtk3ComboBox.DumpPrivateStructValues(ADbgEvent: String);
    +procedure TGtk3ComboBox.DumpPrivateStructValues(const ADbgEvent: String);
     var
       AComboWidget: PGtkComboBox;
       APrivate: PGtkComboBoxPrivate;
    @@ -6253,7 +6253,7 @@
         Result := '';
     end;
     
    -procedure TGtk3Button.setText(AValue: String);
    +procedure TGtk3Button.setText(const AValue: String);
     begin
       if IsWidgetOk then
         PGtkButton(FWidget)^.set_label(PgChar(AValue));
    @@ -6557,7 +6557,7 @@
         PGtkWindow(Widget)^.set_skip_taskbar_hint(AValue);
     end;
     
    -procedure TGtk3Window.SetTitle(AValue: String);
    +procedure TGtk3Window.SetTitle(const AValue: String);
     begin
       PGtkWindow(FWidget)^.set_title(PGChar(AValue));
     end;
    @@ -6692,7 +6692,7 @@
       Result := Title;
     end;
     
    -procedure TGtk3Window.setText(AValue: String);
    +procedure TGtk3Window.setText(const AValue: String);
     begin
       Title := AValue;
     end;
    @@ -6853,7 +6853,7 @@
       Result := FText;
     end;
     
    -procedure TGtk3HintWindow.setText(AValue: String);
    +procedure TGtk3HintWindow.setText(const AValue: String);
     begin
       FText := AValue;
     end;
    Index: lcl/interfaces/gtk3/gtk3wsdialogs.pp
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3wsdialogs.pp	(revision 61348)
    +++ lcl/interfaces/gtk3/gtk3wsdialogs.pp	(working copy)
    @@ -230,7 +230,7 @@
         end;
       end;
     
    -  procedure AddEntries(const Desc: string; MultiMask: string);
    +  procedure AddEntries(const Desc: string; const MultiMask: string);
       var i: integer;
         CurDesc: string;
       begin
    
    str.diff (10,286 bytes)

Relationships

related to 0035437 resolvedJuha Manninen Lazarus Font orientation unnecessarily limited to whole degrees on Linux 

Activities

Alexey Tor.

2019-06-09 13:20

reporter  

gtk3fix.diff (3,934 bytes)
Index: lcl/interfaces/gtk3/gtk3objects.pas
===================================================================
--- lcl/interfaces/gtk3/gtk3objects.pas	(revision 61344)
+++ lcl/interfaces/gtk3/gtk3objects.pas	(working copy)
@@ -59,10 +59,10 @@
     FLogFont: TLogFont;
     FFontName: String;
     FHandle: PPangoFontDescription;
-    procedure SetFontName(AValue: String);
+    procedure SetFontName(const AValue: String);
   public
     constructor Create(ACairo: Pcairo_t; AWidget: PGtkWidget = nil);
-    constructor Create(ALogFont: TLogFont; ALongFontName: String);
+    constructor Create(ALogFont: TLogFont; const ALongFontName: String);
     destructor Destroy; override;
     property FontName: String read FFontName write SetFontName;
     property Handle: PPangoFontDescription read FHandle;
@@ -230,8 +230,8 @@
     procedure drawPoint(x1: Integer; y1: Integer);
     procedure drawRect(x1: Integer; y1: Integer; w: Integer; h: Integer; const AFill: Boolean);
     procedure drawRoundRect(x, y, w, h, rx, ry: Integer);
-    procedure drawText(x: Integer; y: Integer; s: String); overload;
-    procedure drawText(x,y,w,h,flags: Integer; s: String); overload;
+    procedure drawText(x: Integer; y: Integer; const s: String); overload;
+    procedure drawText(x,y,w,h,flags: Integer; const s: String); overload;
     procedure drawLine(x1: Integer; y1: Integer; x2: Integer; y2: Integer);
     procedure drawEllipse(x: Integer; y: Integer; w: Integer; h: Integer);
     procedure drawSurface(targetRect: PRect; Surface: Pcairo_surface_t; sourceRect: PRect;
@@ -282,7 +282,7 @@
   end;
 
 function CheckBitmap(const ABitmap: HBITMAP; const AMethodName: String;
-  AParamName: String = ''): Boolean;
+  const AParamName: String = ''): Boolean;
 procedure Gtk3WordWrap(DC: HDC; AText: PChar;
   MaxWidthInPixel: integer; out Lines: PPChar; out LineCount: integer);
 
@@ -324,7 +324,7 @@
   Returns: If the bitmap is valid
  ------------------------------------------------------------------------------}
 function CheckBitmap(const ABitmap: HBITMAP; const AMethodName: String;
-  AParamName: String): Boolean;
+  const AParamName: String): Boolean;
 begin
   Result := TObject(ABitmap) is TGtk3Image;
   if Result then Exit;
@@ -419,7 +419,7 @@
 
 { TGtk3Font }
 
-procedure TGtk3Font.SetFontName(AValue: String);
+procedure TGtk3Font.SetFontName(const AValue: String);
 begin
   if FFontName=AValue then Exit;
   FFontName:=AValue;
@@ -461,7 +461,7 @@
   // writeln('TGtk3Font.Create1 ',FFontName);
 end;
 
-constructor TGtk3Font.Create(ALogFont: TLogFont; ALongFontName: String);
+constructor TGtk3Font.Create(ALogFont: TLogFont; const ALongFontName: String);
 var
   AContext: PPangoContext;
   ADescription: PPangoFontDescription;
@@ -1280,7 +1280,7 @@
   RoundRect(x, y, w, h, rx, ry);
 end;
 
-procedure TGtk3DeviceContext.drawText(x: Integer; y: Integer; s: String);
+procedure TGtk3DeviceContext.drawText(x: Integer; y: Integer; const s: String);
 var
   e: cairo_font_extents_t;
   R: Double;
@@ -1312,7 +1312,7 @@
   end;
 end;
 
-procedure TGtk3DeviceContext.drawText(x, y, w, h, flags: Integer; s: String
+procedure TGtk3DeviceContext.drawText(x, y, w, h, flags: Integer; const s: String
   );
 var
   e: cairo_font_extents_t;
Index: lcl/interfaces/gtk3/gtk3winapi.inc
===================================================================
--- lcl/interfaces/gtk3/gtk3winapi.inc	(revision 61344)
+++ lcl/interfaces/gtk3/gtk3winapi.inc	(working copy)
@@ -788,7 +788,7 @@
     var TextLeft,TextTop: Integer);
   var
     OffsX, OffsY: integer;
-    Angle: Integer;
+    Angle: Double;
     Size: TSize;
     R: TRect;
   begin
@@ -795,9 +795,9 @@
     R := SavedRect;
     OffsX := R.Right - R.Left;
     OffsY := R.Bottom - R.Top;
-    Size.cX := OffsX;
+    Size.cx := OffsX;
     Size.cy := OffsY;
-    Angle := AFontAngle div 10;
+    Angle := AFontAngle / 10;
     if Angle < 0 then
       Angle := 360 + Angle;
 
gtk3fix.diff (3,934 bytes)

Juha Manninen

2019-06-09 21:57

developer   ~0116648

I split the "const" parameter changes to a different commit.
I applied the font angle calculation, too, although it feels useless because the Orientation is not rendered.

Alexey Tor.

2019-06-09 23:20

reporter   ~0116650

I made mass search by CudaText and added "const" for string params, to gtk2/gtk3.

str.diff (10,286 bytes)
Index: lcl/interfaces/gtk2/gtk2trayicon.inc
===================================================================
--- lcl/interfaces/gtk2/gtk2trayicon.inc	(revision 61348)
+++ lcl/interfaces/gtk2/gtk2trayicon.inc	(working copy)
@@ -45,7 +45,7 @@
     destructor Destroy; override;
     procedure Show;
     function GetPosition: TPoint;
-    procedure Update(NewPixBuf: PGdkPixbuf; NewHint: String);
+    procedure Update(NewPixBuf: PGdkPixbuf; const NewHint: String);
   end;
 
 const
@@ -479,7 +479,7 @@
   end;
 end;
 
-procedure TGtk2TrayIconHandle.Update(NewPixBuf: PGdkPixbuf; NewHint: String);
+procedure TGtk2TrayIconHandle.Update(NewPixBuf: PGdkPixbuf; const NewHint: String);
 begin
 {$ifdef UseStatusIcon}
   if FStatusIcon <> nil then
Index: lcl/interfaces/gtk3/gtk3widgets.pas
===================================================================
--- lcl/interfaces/gtk3/gtk3widgets.pas	(revision 61348)
+++ lcl/interfaces/gtk3/gtk3widgets.pas	(working copy)
@@ -94,7 +94,7 @@
     function _Release: LongInt; {$IFDEF WINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
     function EatArrowKeys(const AKey: Word): Boolean; virtual;
     function getText: String; virtual;
-    procedure setText(AValue: String); virtual;
+    procedure setText(const AValue: String); virtual;
     function GetContext: HDC; virtual;
     function CreateWidget(const Params: TCreateParams):PGtkWidget; virtual;
     procedure DestroyWidget; virtual;
@@ -209,7 +209,7 @@
   protected
     function EatArrowKeys(const AKey: Word): Boolean; override;
     function getText: String; override;
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
   public
     procedure InitializeWidget; override;
@@ -331,7 +331,7 @@
     procedure SetStaticBorderStyle(AValue: TStaticBorderStyle);
   protected
     function getText: String; override;
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
   public
     property Alignment: TAlignment read GetAlignment write SetAlignment;
@@ -351,7 +351,7 @@
   private
     FPageLabel: PGtkLabel;
   protected
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
     function getText: String; override;
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
     procedure DestroyWidget; override;
@@ -373,7 +373,7 @@
     procedure SetPageIndex(AIndex: Integer);
     procedure SetShowTabs(const AShowTabs: Boolean);
     procedure SetTabPosition(const ATabPosition: TTabPosition);
-    procedure SetTabLabelText(AChild: TCustomPage; AText: String);
+    procedure SetTabLabelText(AChild: TCustomPage; const AText: String);
     function  GetTabLabelText(AChild: TCustomPage): String;
   end;
 
@@ -431,7 +431,7 @@
   TGtk3MenuItem = class(TGtk3Bin)
   private
     function GetCaption: string;
-    procedure SetCaption(AValue: string);
+    procedure SetCaption(const AValue: string);
   protected
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
   public
@@ -487,7 +487,7 @@
     procedure SetWordWrap(AValue: Boolean);
   protected
     function getText: String; override;
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
     function EatArrowKeys(const AKey: Word): Boolean; override;
   public
@@ -605,7 +605,7 @@
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
     procedure DoBeforeLCLPaint; override;
     function getText: String; override;
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
   public
     property BevelInner: TBevelCut read FBevelInner write FBevelInner;
     property BevelOuter: TBevelCut read FBevelOuter write FBevelOuter;
@@ -618,7 +618,7 @@
   protected
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
     function getText: String; override;
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
   public
   end;
 
@@ -635,9 +635,9 @@
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
     function EatArrowKeys(const AKey: Word): Boolean; override;
     function getText: String; override;
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
   public
-    procedure DumpPrivateStructValues(ADbgEvent: String);
+    procedure DumpPrivateStructValues(const ADbgEvent: String);
   public
     function CanFocus: Boolean; override;
     procedure SetFocus; override;
@@ -664,7 +664,7 @@
     procedure SetSpacing(AValue: Integer);
   protected
     function getText: String; override;
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
   public
     function IsWidgetOk: Boolean; override;
@@ -746,12 +746,12 @@
     function GetTitle: String;
     procedure SetIcon(AValue: PGdkPixBuf);
     procedure SetSkipTaskBarHint(AValue: Boolean);
-    procedure SetTitle(AValue: String);
+    procedure SetTitle(const AValue: String);
   protected
     function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
     function EatArrowKeys(const AKey: Word): Boolean; override;
     function getText: String; override;
-    procedure setText(AValue: String); override;
+    procedure setText(const AValue: String); override;
   public
     // function getClientBounds: TRect; override;
     function getClientRect: TRect; override;
@@ -779,7 +779,7 @@
       FText: String;
     protected
       function getText: String; override;
-      procedure setText(AValue: String); override;
+      procedure setText(const AValue: String); override;
       function CreateWidget(const Params: TCreateParams):PGtkWidget; override;
   end;
 
@@ -2475,7 +2475,7 @@
   Result := '';
 end;
 
-procedure TGtk3Widget.setText(AValue: String);
+procedure TGtk3Widget.setText(const AValue: String);
 begin
   // DebugLn('WARNING: ',dbgsName(LCLObject),' self=',dbgsName(Self),' does not implement setText !');
 end;
@@ -3067,7 +3067,7 @@
   Result := FText;
 end;
 
-procedure TGtk3Panel.setText(AValue: String);
+procedure TGtk3Panel.setText(const AValue: String);
 begin
   if FText = AValue then
     exit;
@@ -3101,7 +3101,7 @@
   end;
 end;
 
-procedure TGtk3GroupBox.setText(AValue: String);
+procedure TGtk3GroupBox.setText(const AValue: String);
 begin
   if IsWidgetOK then
   begin
@@ -3311,7 +3311,7 @@
     Result := '';
 end;
 
-procedure TGtk3Entry.setText(AValue: String);
+procedure TGtk3Entry.setText(const AValue: String);
 begin
   if IsValidHandle and IsWidgetOK then
     PGtkEntry(Widget)^.set_text(PgChar(AValue));
@@ -3731,7 +3731,7 @@
     Result := PGtkLabel(getContainerWidget)^.get_text;
 end;
 
-procedure TGtk3StaticText.setText(AValue: String);
+procedure TGtk3StaticText.setText(const AValue: String);
 begin
   if IsWidgetOk then
     PGtkLabel(getContainerWidget)^.set_text(PgChar(AValue));
@@ -3961,7 +3961,7 @@
 
 { TGtk3Page }
 
-procedure TGtk3Page.setText(AValue: String);
+procedure TGtk3Page.setText(const AValue: String);
 begin
   if Assigned(FPageLabel) then
     FPageLabel^.set_text(PChar(AValue));
@@ -4271,7 +4271,7 @@
     PGtkNoteBook(GetContainerWidget)^.set_tab_pos(GtkPositionTypeMap[ATabPosition]);
 end;
 
-procedure TGtk3NoteBook.SetTabLabelText(AChild: TCustomPage; AText: String);
+procedure TGtk3NoteBook.SetTabLabelText(AChild: TCustomPage; const AText: String);
 begin
   if IsWidgetOK then
     TGtk3Widget(AChild.Handle).setText(AText);
@@ -4362,7 +4362,7 @@
     Result := PGtkMenuItem(FWidget)^.get_label;
 end;
 
-procedure TGtk3MenuItem.SetCaption(AValue: string);
+procedure TGtk3MenuItem.SetCaption(const AValue: string);
 begin
   if IsWidgetOK then
     PGtkMenuItem(FWidget)^.set_label(PgChar(AValue));
@@ -4782,7 +4782,7 @@
   // DebugLn('TGtk3Memo.getText Result=',Result);
 end;
 
-procedure TGtk3Memo.setText(AValue: String);
+procedure TGtk3Memo.setText(const AValue: String);
 var
   ABuffer: PGtkTextBuffer;
   AIter: PGtkTextIter;
@@ -6011,13 +6011,13 @@
     Result := StrPas(PGtkComboBox(GetContainerWidget)^.get_title);
 end;
 
-procedure TGtk3ComboBox.setText(AValue: String);
+procedure TGtk3ComboBox.setText(const AValue: String);
 begin
   if Gtk3IsComboBox(FWidget) then
     PGtkComboBox(GetContainerWidget)^.set_title(PgChar(AValue));
 end;
 
-procedure TGtk3ComboBox.DumpPrivateStructValues(ADbgEvent: String);
+procedure TGtk3ComboBox.DumpPrivateStructValues(const ADbgEvent: String);
 var
   AComboWidget: PGtkComboBox;
   APrivate: PGtkComboBoxPrivate;
@@ -6253,7 +6253,7 @@
     Result := '';
 end;
 
-procedure TGtk3Button.setText(AValue: String);
+procedure TGtk3Button.setText(const AValue: String);
 begin
   if IsWidgetOk then
     PGtkButton(FWidget)^.set_label(PgChar(AValue));
@@ -6557,7 +6557,7 @@
     PGtkWindow(Widget)^.set_skip_taskbar_hint(AValue);
 end;
 
-procedure TGtk3Window.SetTitle(AValue: String);
+procedure TGtk3Window.SetTitle(const AValue: String);
 begin
   PGtkWindow(FWidget)^.set_title(PGChar(AValue));
 end;
@@ -6692,7 +6692,7 @@
   Result := Title;
 end;
 
-procedure TGtk3Window.setText(AValue: String);
+procedure TGtk3Window.setText(const AValue: String);
 begin
   Title := AValue;
 end;
@@ -6853,7 +6853,7 @@
   Result := FText;
 end;
 
-procedure TGtk3HintWindow.setText(AValue: String);
+procedure TGtk3HintWindow.setText(const AValue: String);
 begin
   FText := AValue;
 end;
Index: lcl/interfaces/gtk3/gtk3wsdialogs.pp
===================================================================
--- lcl/interfaces/gtk3/gtk3wsdialogs.pp	(revision 61348)
+++ lcl/interfaces/gtk3/gtk3wsdialogs.pp	(working copy)
@@ -230,7 +230,7 @@
     end;
   end;
 
-  procedure AddEntries(const Desc: string; MultiMask: string);
+  procedure AddEntries(const Desc: string; const MultiMask: string);
   var i: integer;
     CurDesc: string;
   begin
str.diff (10,286 bytes)

Juha Manninen

2019-06-12 21:44

developer   ~0116701

I applied the new patch in r61370. Thanks.

Issue History

Date Modified Username Field Change
2019-06-09 13:20 Alexey Tor. New Issue
2019-06-09 13:20 Alexey Tor. File Added: gtk3fix.diff
2019-06-09 16:42 Juha Manninen Assigned To => Juha Manninen
2019-06-09 16:42 Juha Manninen Status new => assigned
2019-06-09 16:43 Juha Manninen Relationship added related to 0035437
2019-06-09 21:57 Juha Manninen Status assigned => resolved
2019-06-09 21:57 Juha Manninen Resolution open => fixed
2019-06-09 21:57 Juha Manninen Fixed in Revision => r61347
2019-06-09 21:57 Juha Manninen LazTarget => -
2019-06-09 21:57 Juha Manninen Widgetset GTK 3 => GTK 3
2019-06-09 21:57 Juha Manninen Note Added: 0116648
2019-06-09 23:20 Alexey Tor. File Added: str.diff
2019-06-09 23:20 Alexey Tor. Note Added: 0116650
2019-06-09 23:20 Alexey Tor. Status resolved => assigned
2019-06-09 23:20 Alexey Tor. Resolution fixed => reopened
2019-06-12 21:44 Juha Manninen Status assigned => resolved
2019-06-12 21:44 Juha Manninen Widgetset GTK 3 => GTK 3
2019-06-12 21:44 Juha Manninen Note Added: 0116701
2019-06-13 11:39 Alexey Tor. Status resolved => closed