mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-30 01:09:29 +02:00
LCL-GTK3: Turn WriteLn into DebugLn. Make sure they compile. Cleanup.
This commit is contained in:
parent
b2b3689434
commit
02115d373b
@ -49,7 +49,7 @@ unit LazCairo1;
|
|||||||
October 2007
|
October 2007
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{$mode ObjFpc}
|
{$mode ObjFpc}{$H+}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -195,13 +195,13 @@ type
|
|||||||
Tcairo_content_t = cairo_content_t;
|
Tcairo_content_t = cairo_content_t;
|
||||||
|
|
||||||
cairo_format_t = (
|
cairo_format_t = (
|
||||||
// CAIRO_FORMAT_INVALID = -1,
|
CAIRO_FORMAT_INVALID = -1,
|
||||||
CAIRO_FORMAT_ARGB32,
|
CAIRO_FORMAT_ARGB32,
|
||||||
CAIRO_FORMAT_RGB24,
|
CAIRO_FORMAT_RGB24,
|
||||||
CAIRO_FORMAT_A8,
|
CAIRO_FORMAT_A8,
|
||||||
CAIRO_FORMAT_A1
|
CAIRO_FORMAT_A1,
|
||||||
// CAIRO_FORMAT_RGB16_565
|
CAIRO_FORMAT_RGB16_565,
|
||||||
// CAIRO_FORMAT_RGB30
|
CAIRO_FORMAT_RGB30
|
||||||
);
|
);
|
||||||
|
|
||||||
cairo_extend_t = (
|
cairo_extend_t = (
|
||||||
|
@ -22,8 +22,7 @@
|
|||||||
|
|
||||||
unit LazPangoCairo1;
|
unit LazPangoCairo1;
|
||||||
|
|
||||||
{$mode objfpc}
|
{$mode objfpc}{$H+}
|
||||||
{$H+}
|
|
||||||
|
|
||||||
interface
|
interface
|
||||||
uses LazGlib2, LazPango1, LazCairo1, LazGObject2;
|
uses LazGlib2, LazPango1, LazCairo1, LazGObject2;
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
unit gtk3boxes;
|
{
|
||||||
|
*****************************************************************************
|
||||||
|
This file is part of the Lazarus Component Library (LCL)
|
||||||
|
|
||||||
|
See the file COPYING.modifiedLGPL.txt, included in this distribution,
|
||||||
|
for details about the license.
|
||||||
|
*****************************************************************************
|
||||||
|
}
|
||||||
|
unit Gtk3Boxes;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
@ -262,7 +262,8 @@ begin
|
|||||||
else
|
else
|
||||||
ANaturalHeight := 0;
|
ANaturalHeight := 0;
|
||||||
}
|
}
|
||||||
// writeln('1.minimumheight ',AMinHeight,' naturalheight ',ANaturalHeight,' min ',dbgs(minimum_height <> nil),' nat ',dbgs(natural_height <> nil));
|
//DebugLn(['1.minimumheight ',AMinHeight,' naturalheight ',ANaturalHeight,
|
||||||
|
// ' min ',dbgs(minimum_height <> nil),' nat ',dbgs(natural_height<>nil)]);
|
||||||
|
|
||||||
AWinControl := GetControl(widget);
|
AWinControl := GetControl(widget);
|
||||||
if AWinControl = Nil then exit;
|
if AWinControl = Nil then exit;
|
||||||
@ -291,7 +292,7 @@ begin
|
|||||||
if natural_height <> nil then
|
if natural_height <> nil then
|
||||||
natural_height^ := gint(MeasureItemStruct.itemHeight);
|
natural_height^ := gint(MeasureItemStruct.itemHeight);
|
||||||
|
|
||||||
// writeln('Final cell height ',MeasureItemStruct.itemHeight);
|
//DebugLn('Final cell height ',MeasureItemStruct.itemHeight);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure LCLIntfCellRenderer_GetSize(cell: PGtkCellRenderer; widget: PGtkWidget;
|
procedure LCLIntfCellRenderer_GetSize(cell: PGtkCellRenderer; widget: PGtkWidget;
|
||||||
@ -620,7 +621,7 @@ const
|
|||||||
class_size: SizeOf(TLCLIntfCellRenderer) + 1024;
|
class_size: SizeOf(TLCLIntfCellRenderer) + 1024;
|
||||||
base_init: nil; // TGBaseInitFunc;
|
base_init: nil; // TGBaseInitFunc;
|
||||||
base_finalize: nil; // TGBaseFinalizeFunc;
|
base_finalize: nil; // TGBaseFinalizeFunc;
|
||||||
class_init: @LCLIntfCellRenderer_ClassInit;
|
class_init: TGClassInitFunc(@LCLIntfCellRenderer_ClassInit);
|
||||||
class_finalize: nil; // @LCLIntfCellRenderer_ClassFinalize; // nil; // TGClassFinalizeFunc;
|
class_finalize: nil; // @LCLIntfCellRenderer_ClassFinalize; // nil; // TGClassFinalizeFunc;
|
||||||
class_data: nil;
|
class_data: nil;
|
||||||
instance_size: SizeOf(TLCLIntfCellRenderer) + 1024;
|
instance_size: SizeOf(TLCLIntfCellRenderer) + 1024;
|
||||||
@ -641,7 +642,7 @@ end;
|
|||||||
function LCLIntfCellRenderer_New: PGtkCellRenderer;
|
function LCLIntfCellRenderer_New: PGtkCellRenderer;
|
||||||
begin
|
begin
|
||||||
// PGtkCellRenderer(g_type_class_ref(LCLIntfCellRenderer_GetType));
|
// PGtkCellRenderer(g_type_class_ref(LCLIntfCellRenderer_GetType));
|
||||||
Result := g_object_new(LCLIntfCellRenderer_GetType, nil,[]);
|
Result := PGtkCellRenderer(g_object_new(LCLIntfCellRenderer_GetType, nil,[]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure LCLIntfCellRenderer_CellDataFunc(cell_layout:PGtkCellLayout;
|
procedure LCLIntfCellRenderer_CellDataFunc(cell_layout:PGtkCellLayout;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{$DEFINE GTK3}
|
{$DEFINE GTK3}
|
||||||
{$DEFINE USEGTK3ALPHA}
|
|
||||||
{. $DEFINE GTK3DEBUGCORE}
|
{. $DEFINE GTK3DEBUGCORE}
|
||||||
{. $DEFINE GTK3DEBUGSIZE}
|
{. $DEFINE GTK3DEBUGSIZE}
|
||||||
{. $DEFINE VerboseGtk3DeviceContext}
|
{. $DEFINE VerboseGtk3DeviceContext}
|
||||||
@ -12,35 +11,6 @@
|
|||||||
{. $DEFINE GTK3DEBUGKEYPRESS}
|
{. $DEFINE GTK3DEBUGKEYPRESS}
|
||||||
{. $DEFINE GTK3DEBUGMENUS}
|
{. $DEFINE GTK3DEBUGMENUS}
|
||||||
{. $DEFINE GTK3DEBUGPREFERREDSIZE}
|
{. $DEFINE GTK3DEBUGPREFERREDSIZE}
|
||||||
{$IFNDEF USEGTK3ALPHA}
|
|
||||||
(*
|
|
||||||
{$error ' . . . '}
|
|
||||||
{$error ' \|/ '}
|
|
||||||
{$error ' `--+--' '}
|
|
||||||
{$error ' /|\ '}
|
|
||||||
{$error ' ' | ' '}
|
|
||||||
{$error ' | '}
|
|
||||||
{$error ' | '}
|
|
||||||
{$error ' ,--'#`--. '}
|
|
||||||
{$error ' |#######| '}
|
|
||||||
{$error ' _.-'#######`-._ '}
|
|
||||||
{$error ' ,-'###############`-. '}
|
|
||||||
{$error ' ,'#####################`, '}
|
|
||||||
{$error ' /#########################\ '}
|
|
||||||
{$error ' |###########################| '}
|
|
||||||
{$error '|#############################| '}
|
|
||||||
{$error '|#############################| '}
|
|
||||||
{$error '|#############################| '}
|
|
||||||
{$error '|#############################| '}
|
|
||||||
{$error ' |###########################| '}
|
|
||||||
{$error ' \#########################/ '}
|
|
||||||
{$error ' `.#####################,' '}
|
|
||||||
{$error ' `._###############_,' '}
|
|
||||||
{$error ' `--..#####..--' '}
|
|
||||||
*)
|
|
||||||
{$error 'THIS IS CURRENTLY ALPHA CODE AND IT IS USED ONLY BY GTK3LCL DEVELOPERS.'}
|
|
||||||
{$error 'IF YOU WANT TO TEST gtk3 THEN UNCOMMENT DEFINE USEGTK3ALPHA ABOVE.'}
|
|
||||||
{$error 'PLEASE DO NOT FILL BUG REPORTS ON MANTIS WHILE GTK3LCL IS IN ALPHA STAGE'}
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
unit gtk3int;
|
unit gtk3int;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
{$i gtk3defines.inc}
|
{$i gtk3defines.inc}
|
||||||
{$mode objfpc}
|
|
||||||
{$H+}
|
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
@ -309,15 +309,15 @@ function TGtk3WidgetSet.RawImage_DescriptionFromBitmap(ABitmap: HBITMAP; out ADe
|
|||||||
const
|
const
|
||||||
CairoImageFormatToDepth: array[cairo_format_t] of integer =
|
CairoImageFormatToDepth: array[cairo_format_t] of integer =
|
||||||
(
|
(
|
||||||
// {CAIRO_FORMAT_RGB30}15,
|
{CAIRO_FORMAT_RGB30} 15,
|
||||||
// {CAIRO_FORMAT_RGB16_565}16,
|
{CAIRO_FORMAT_RGB16_565} 16,
|
||||||
|
{CAIRO_FORMAT_ARGB32} 32,
|
||||||
{CAIRO_FORMAT_ARGB32} 32,
|
{CAIRO_FORMAT_RGB24} 24,
|
||||||
{CAIRO_FORMAT_RGB24} 24,
|
{CAIRO_FORMAT_A8} 8,
|
||||||
{CAIRO_FORMAT_A8} 8,
|
{CAIRO_FORMAT_A1} 1,
|
||||||
{CAIRO_FORMAT_A1} 1
|
{CAIRO_FORMAT_INVALID} -1
|
||||||
);
|
);
|
||||||
|
//============================
|
||||||
var
|
var
|
||||||
Image: TGtk3Image absolute ABitmap;
|
Image: TGtk3Image absolute ABitmap;
|
||||||
|
|
||||||
@ -993,7 +993,7 @@ begin
|
|||||||
Desc.Height := DCSize.cy;
|
Desc.Height := DCSize.cy;
|
||||||
|
|
||||||
{$ifdef VerboseGtk3WinApi}
|
{$ifdef VerboseGtk3WinApi}
|
||||||
WriteLn('Trace:< [WinAPI GetRawImageFromDevice]');
|
DebugLn('Trace:< [WinAPI GetRawImageFromDevice]');
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
(*
|
(*
|
||||||
@ -1096,7 +1096,8 @@ begin
|
|||||||
Widget:=GetStyleWidget(lgsVScale);
|
Widget:=GetStyleWidget(lgsVScale);
|
||||||
MinWidth:=Widget^.requisition.width;
|
MinWidth:=Widget^.requisition.width;
|
||||||
end;
|
end;
|
||||||
//DebugLn(['TGtk3WidgetSet.GetControlConstraints ',DbgSName(SizeConstraints.Control),' ',MinWidth,',',MinHeight]);
|
//DebugLn(['TGtk3WidgetSet.GetControlConstraints ',DbgSName(SizeConstraints.Control),
|
||||||
|
// ' ',MinWidth,',',MinHeight]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SizeConstraints.SetInterfaceConstraints(MinWidth,MinHeight,
|
SizeConstraints.SetInterfaceConstraints(MinWidth,MinHeight,
|
||||||
@ -1181,7 +1182,7 @@ function waithandle_iocallback({%H-}source: PGIOChannel; condition: TGIOConditio
|
|||||||
// var
|
// var
|
||||||
// lEventHandler: PWaitHandleEventHandler absolute data;
|
// lEventHandler: PWaitHandleEventHandler absolute data;
|
||||||
begin
|
begin
|
||||||
//debugln('waithandle_iocallback lEventHandler=',HexStr(Cardinal(lEventHandler),8));
|
//DebugLn(['waithandle_iocallback lEventHandler=',HexStr(Cardinal(lEventHandler),8)]);
|
||||||
// lEventHandler^.OnEvent(lEventHandler^.UserData, condition);
|
// lEventHandler^.OnEvent(lEventHandler^.UserData, condition);
|
||||||
Result := true;
|
Result := true;
|
||||||
end;
|
end;
|
||||||
@ -1203,7 +1204,8 @@ begin
|
|||||||
lEventHandler^.OnEvent := AEventHandler;
|
lEventHandler^.OnEvent := AEventHandler;
|
||||||
lEventHandler^.GSourceID := g_io_add_watch(giochannel,
|
lEventHandler^.GSourceID := g_io_add_watch(giochannel,
|
||||||
AFlags, @waithandle_iocallback, lEventHandler);
|
AFlags, @waithandle_iocallback, lEventHandler);
|
||||||
//debugln('TGtk3WidgetSet.AddEventHandler lEventHandler=',HexStr(Cardinal(lEventHandler),8),' AHandle=',dbgs(lEventHandler^.Handle));
|
//DebugLn(['TGtk3WidgetSet.AddEventHandler lEventHandler=',HexStr(Cardinal(lEventHandler),8),
|
||||||
|
// ' AHandle=',dbgs(lEventHandler^.Handle)]);
|
||||||
lEventHandler^.PrevHandler := nil;
|
lEventHandler^.PrevHandler := nil;
|
||||||
lEventHandler^.NextHandler := FWaitHandles;
|
lEventHandler^.NextHandler := FWaitHandles;
|
||||||
if FWaitHandles <> nil then
|
if FWaitHandles <> nil then
|
||||||
@ -1229,7 +1231,8 @@ begin
|
|||||||
lEventHandler^.PrevHandler^.NextHandler := lEventHandler^.NextHandler;
|
lEventHandler^.PrevHandler^.NextHandler := lEventHandler^.NextHandler;
|
||||||
if lEventHandler^.NextHandler <> nil then
|
if lEventHandler^.NextHandler <> nil then
|
||||||
lEventHandler^.NextHandler^.PrevHandler := lEventHandler^.PrevHandler;
|
lEventHandler^.NextHandler^.PrevHandler := lEventHandler^.PrevHandler;
|
||||||
//debugln('TGtk3WidgetSet.RemoveEventHandler lEventHandler=',HexStr(Cardinal(lEventHandler),8),' AHandle=',dbgs(lEventHandler^.Handle));
|
//DebugLn(['TGtk3WidgetSet.RemoveEventHandler lEventHandler=',HexStr(Cardinal(lEventHandler),8),
|
||||||
|
// ' AHandle=',dbgs(lEventHandler^.Handle)]);
|
||||||
Dispose(lEventHandler);
|
Dispose(lEventHandler);
|
||||||
*)
|
*)
|
||||||
AHandler := nil;
|
AHandler := nil;
|
||||||
@ -1243,7 +1246,8 @@ begin
|
|||||||
// g_source_remove(lEventHandler^.GSourceID);
|
// g_source_remove(lEventHandler^.GSourceID);
|
||||||
// lEventHandler^.GSourceID := g_io_add_watch(lEventHandler^.GIOChannel,
|
// lEventHandler^.GSourceID := g_io_add_watch(lEventHandler^.GIOChannel,
|
||||||
// NewFlags, @waithandle_iocallback, lEventHandler);
|
// NewFlags, @waithandle_iocallback, lEventHandler);
|
||||||
//debugln('TGtk3WidgetSet.SetEventHandlerFlags lEventHandler=',HexStr(Cardinal(lEventHandler),8),' AHandle=',dbgs(lEventHandler^.Handle));
|
//DebugLn(['TGtk3WidgetSet.SetEventHandlerFlags lEventHandler=',HexStr(Cardinal(lEventHandler),8),
|
||||||
|
// ' AHandle=',dbgs(lEventHandler^.Handle)]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGtk3WidgetSet.SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
|
procedure TGtk3WidgetSet.SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
for details about the license.
|
for details about the license.
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
unit gtk3objects;
|
unit Gtk3Objects;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
{$i gtk3defines.inc}
|
{$i gtk3defines.inc}
|
||||||
{$mode objfpc}
|
|
||||||
{$H+}
|
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -736,11 +736,11 @@ begin
|
|||||||
if not AOwnsContext then
|
if not AOwnsContext then
|
||||||
begin
|
begin
|
||||||
AContext := gtk_widget_get_pango_context(AWidget);
|
AContext := gtk_widget_get_pango_context(AWidget);
|
||||||
// DebugLn('TGtk3Font.Create AContext created from widget ....context=',dbgHex(PtrUInt(AContext)));
|
//DebugLn('TGtk3Font.Create AContext created from widget ....context=',dbgHex(PtrUInt(AContext)));
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
AContext := pango_cairo_create_context(ACairo);
|
AContext := pango_cairo_create_context(ACairo);
|
||||||
// DebugLn('TGtk3Font.Create AContext created from pango cairo ....');
|
//DebugLn('TGtk3Font.Create AContext created from pango cairo ....');
|
||||||
end;
|
end;
|
||||||
FHandle := pango_font_description_copy(pango_context_get_font_description(AContext));
|
FHandle := pango_font_description_copy(pango_context_get_font_description(AContext));
|
||||||
FFontName := pango_font_description_get_family(FHandle);
|
FFontName := pango_font_description_get_family(FHandle);
|
||||||
@ -749,18 +749,18 @@ begin
|
|||||||
if FHandle^.get_size_is_absolute then
|
if FHandle^.get_size_is_absolute then
|
||||||
begin
|
begin
|
||||||
FHandle^.set_absolute_size(FHandle^.get_size);
|
FHandle^.set_absolute_size(FHandle^.get_size);
|
||||||
// writeln('**TGtk3Font.Create size is absolute ',FFontName,' size ',FHandle^.get_size);
|
//DebugLn(['**TGtk3Font.Create size is absolute ',FFontName,' size ',FHandle^.get_size]);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
FHandle^.set_size(FHandle^.get_size);
|
FHandle^.set_size(FHandle^.get_size);
|
||||||
// writeln('*TGtk3Font.Create size is not absolute ',FFontName,' size ',FHandle^.get_size);
|
//DebugLn(['*TGtk3Font.Create size is not absolute ',FFontName,' size ',FHandle^.get_size]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FLayout^.set_font_description(FHandle);
|
FLayout^.set_font_description(FHandle);
|
||||||
// writeln('TGtk3Font.Create1 ',FFontName);
|
//DebugLn('TGtk3Font.Create1 ',FFontName);
|
||||||
if AOwnsContext then
|
if AOwnsContext then
|
||||||
g_object_unref(AContext);
|
g_object_unref(AContext);
|
||||||
// writeln('TGtk3Font.Create1 ',FFontName);
|
//DebugLn('TGtk3Font.Create1 ',FFontName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TGtk3Font.Create(ALogFont: TLogFont; const ALongFontName: String);
|
constructor TGtk3Font.Create(ALogFont: TLogFont; const ALongFontName: String);
|
||||||
@ -1368,7 +1368,7 @@ begin
|
|||||||
else
|
else
|
||||||
AFont := FFont;
|
AFont := FFont;
|
||||||
if AFont<>nil then ;
|
if AFont<>nil then ;
|
||||||
debugln(['TGtk3DeviceContext.ApplyFont ToDo']);
|
DebugLn(['TGtk3DeviceContext.ApplyFont ToDo']);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGtk3DeviceContext.ApplyPen;
|
procedure TGtk3DeviceContext.ApplyPen;
|
||||||
@ -1459,7 +1459,7 @@ var
|
|||||||
ARect: TGdkRectangle;
|
ARect: TGdkRectangle;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseGtk3DeviceContext}
|
{$ifdef VerboseGtk3DeviceContext}
|
||||||
WriteLn('TGtk3DeviceContext.Create (',
|
DebugLn('TGtk3DeviceContext.Create (',
|
||||||
' WidgetHandle: ', dbghex(PtrInt(AWidget)),
|
' WidgetHandle: ', dbghex(PtrInt(AWidget)),
|
||||||
' FromPaintEvent:',BoolToStr(APaintEvent),' )');
|
' FromPaintEvent:',BoolToStr(APaintEvent),' )');
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -1533,7 +1533,7 @@ constructor TGtk3DeviceContext.Create(AWindow: PGdkWindow;
|
|||||||
const APaintEvent: Boolean);
|
const APaintEvent: Boolean);
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseGtk3DeviceContext}
|
{$ifdef VerboseGtk3DeviceContext}
|
||||||
WriteLn('TGtk3DeviceContext.Create (',
|
DebugLn('TGtk3DeviceContext.Create (',
|
||||||
' WindowHandle: ', dbghex(PtrInt(AWindow)),
|
' WindowHandle: ', dbghex(PtrInt(AWindow)),
|
||||||
' FromPaintEvent:',BoolToStr(APaintEvent),' )');
|
' FromPaintEvent:',BoolToStr(APaintEvent),' )');
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -1562,7 +1562,7 @@ var
|
|||||||
AGdkRect: TGdkRectangle;
|
AGdkRect: TGdkRectangle;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseGtk3DeviceContext}
|
{$ifdef VerboseGtk3DeviceContext}
|
||||||
WriteLn('TGtk3DeviceContext.CreateFromCairo (',
|
DebugLn('TGtk3DeviceContext.CreateFromCairo (',
|
||||||
' WidgetHandle: ', dbghex(PtrInt(AWidget)),
|
' WidgetHandle: ', dbghex(PtrInt(AWidget)),
|
||||||
' FromPaintEvent:',BoolToStr(True),' )');
|
' FromPaintEvent:',BoolToStr(True),' )');
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -1584,7 +1584,7 @@ end;
|
|||||||
destructor TGtk3DeviceContext.Destroy;
|
destructor TGtk3DeviceContext.Destroy;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseGtk3DeviceContext}
|
{$ifdef VerboseGtk3DeviceContext}
|
||||||
WriteLn('TGtk3DeviceContext.Destroy ',dbgHex(PtrUInt(Self)));
|
DebugLn('TGtk3DeviceContext.Destroy ',dbgHex(PtrUInt(Self)));
|
||||||
{$endif}
|
{$endif}
|
||||||
DeleteObjects;
|
DeleteObjects;
|
||||||
if FOwnsCairo and (pcr <> nil) then
|
if FOwnsCairo and (pcr <> nil) then
|
||||||
@ -2003,7 +2003,7 @@ var
|
|||||||
ATempBrush: TGtk3Brush;
|
ATempBrush: TGtk3Brush;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseGtk3DeviceContext}
|
{$ifdef VerboseGtk3DeviceContext}
|
||||||
// WriteLn('TGtk3DeviceContext.fillRect ',Format('x %d y %d w %d h %d',[x, y, w, h]));
|
//DebugLn('TGtk3DeviceContext.fillRect ',Format('x %d y %d w %d h %d',[x, y, w, h]));
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
cairo_save(pcr);
|
cairo_save(pcr);
|
||||||
@ -2173,7 +2173,6 @@ end;
|
|||||||
function TGtk3DeviceContext.drawFocusRect(const aRect: TRect): boolean;
|
function TGtk3DeviceContext.drawFocusRect(const aRect: TRect): boolean;
|
||||||
var
|
var
|
||||||
Context: PGtkStyleContext;
|
Context: PGtkStyleContext;
|
||||||
//AValue: TGValue;
|
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
|
|
||||||
unit gtk3private;
|
unit Gtk3Private;
|
||||||
|
|
||||||
{$i gtk3defines.inc}
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$i gtk3defines.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
@ -13,9 +13,10 @@
|
|||||||
for details about the license.
|
for details about the license.
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
unit gtk3procs;
|
unit Gtk3Procs;
|
||||||
{$i gtk3defines.inc}
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$i gtk3defines.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -839,7 +840,7 @@ begin
|
|||||||
{$IFDEF NoStyle}
|
{$IFDEF NoStyle}
|
||||||
exit;
|
exit;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
//debugln('UpdateSysColorMap ',GetWidgetDebugReport(Widget));
|
//DebugLn('UpdateSysColorMap ',GetWidgetDebugReport(Widget));
|
||||||
// gtk_widget_set_rc_style(Widget);
|
// gtk_widget_set_rc_style(Widget);
|
||||||
MainStyle := Widget^.get_style;
|
MainStyle := Widget^.get_style;
|
||||||
if MainStyle = nil then exit;
|
if MainStyle = nil then exit;
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
|
|
||||||
unit gtk3widgets;
|
unit Gtk3Widgets;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
{$i gtk3defines.inc}
|
{$i gtk3defines.inc}
|
||||||
{$mode objfpc}
|
|
||||||
{$H+}
|
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -1050,6 +1050,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
// DebugLn('****** GDK_MAP FOR ',dbgsName(TGtk3Widget(Data).LCLObject));
|
// DebugLn('****** GDK_MAP FOR ',dbgsName(TGtk3Widget(Data).LCLObject));
|
||||||
end;
|
end;
|
||||||
|
GDK_UNMAP:
|
||||||
|
begin
|
||||||
|
// DebugLn('****** GDK_UNMAP FOR ',dbgsName(TGtk3Widget(Data).LCLObject));
|
||||||
|
end;
|
||||||
GDK_PROPERTY_NOTIFY:
|
GDK_PROPERTY_NOTIFY:
|
||||||
begin
|
begin
|
||||||
// DebugLn('****** GDK_PROPERTY_NOTIFY FOR ',dbgsName(TGtk3Widget(Data).LCLObject));
|
// DebugLn('****** GDK_PROPERTY_NOTIFY FOR ',dbgsName(TGtk3Widget(Data).LCLObject));
|
||||||
@ -1344,8 +1348,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
otherwise
|
otherwise
|
||||||
DebugLn('****** GDK unhandled event type ' + dbgsName(TGtk3Widget(Data).LCLObject));
|
DebugLn('****** GDK unhandled event type ' + dbgsName(TGtk3Widget(Data).LCLObject));
|
||||||
WriteLn(event^.type_);
|
// DebugLn(event^.type_);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1607,7 +1610,7 @@ var
|
|||||||
Range: PGtkRange;
|
Range: PGtkRange;
|
||||||
begin
|
begin
|
||||||
{$IFDEF SYNSCROLLDEBUG}
|
{$IFDEF SYNSCROLLDEBUG}
|
||||||
debugln(['Gtk3ScrolledWindowScrollEvent ']);
|
DebugLn(['Gtk3ScrolledWindowScrollEvent ']);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Result := False;
|
Result := False;
|
||||||
case AEvent^.scroll.direction of
|
case AEvent^.scroll.direction of
|
||||||
@ -2558,7 +2561,7 @@ begin
|
|||||||
FWidget^.Visible := AValue;
|
FWidget^.Visible := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGtk3Widget.QueryInterface(constref iid: TGuid; out obj): LongInt; cdecl;
|
function TGtk3Widget.QueryInterface(constref iid: TGuid; out obj): LongInt; {$IFDEF WINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
|
||||||
begin
|
begin
|
||||||
if GetInterface(iid, obj) then
|
if GetInterface(iid, obj) then
|
||||||
Result := 0
|
Result := 0
|
||||||
@ -2566,12 +2569,12 @@ begin
|
|||||||
Result := E_NOINTERFACE;
|
Result := E_NOINTERFACE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGtk3Widget._AddRef: LongInt; cdecl;
|
function TGtk3Widget._AddRef: LongInt; {$IFDEF WINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
|
||||||
begin
|
begin
|
||||||
Result := -1; // no ref counting
|
Result := -1; // no ref counting
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGtk3Widget._Release: LongInt; cdecl;
|
function TGtk3Widget._Release: LongInt; {$IFDEF WINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
|
||||||
begin
|
begin
|
||||||
Result := -1;
|
Result := -1;
|
||||||
end;
|
end;
|
||||||
@ -3615,7 +3618,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
if not (atext[i] in ['0'..'9']) then
|
if not (atext[i] in ['0'..'9']) then
|
||||||
begin
|
begin
|
||||||
g_signal_stop_emission_by_name(Self, 'insert-text');
|
g_signal_stop_emission_by_name(PGObject(Self), 'insert-text');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3646,15 +3649,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGtk3Entry.SetBounds(Left, Top, Width, Height: integer);
|
procedure TGtk3Entry.SetBounds(Left, Top, Width, Height: integer);
|
||||||
var val:TGvalue;
|
|
||||||
begin
|
begin
|
||||||
val.clear;
|
|
||||||
val.init(G_TYPE_UINT);
|
|
||||||
val.set_uint(Width);
|
|
||||||
|
|
||||||
inherited SetBounds(Left, Top, Width, Height);
|
inherited SetBounds(Left, Top, Width, Height);
|
||||||
PGtkEntry(FWidget)^.set_property('width-request',@val);
|
|
||||||
val.unset;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGtk3Entry.InitializeWidget;
|
procedure TGtk3Entry.InitializeWidget;
|
||||||
@ -7449,21 +7445,21 @@ begin
|
|||||||
if msk and GDK_WINDOW_STATE_FOCUSED<>0 then
|
if msk and GDK_WINDOW_STATE_FOCUSED<>0 then
|
||||||
begin
|
begin
|
||||||
if AState and GDK_WINDOW_STATE_FOCUSED<>0 then
|
if AState and GDK_WINDOW_STATE_FOCUSED<>0 then
|
||||||
writeln('Focused')
|
DebugLn('Focused')
|
||||||
else
|
else
|
||||||
writeln('Defocused');
|
DebugLn('Defocused');
|
||||||
exit;
|
exit;
|
||||||
end else
|
end else
|
||||||
if msk and GDK_WINDOW_STATE_WITHDRAWN<>0 then
|
if msk and GDK_WINDOW_STATE_WITHDRAWN<>0 then
|
||||||
begin
|
begin
|
||||||
if AState and GDK_WINDOW_STATE_WITHDRAWN<>0 then
|
if AState and GDK_WINDOW_STATE_WITHDRAWN<>0 then
|
||||||
writeln('Shown')
|
DebugLn('Shown')
|
||||||
else
|
else
|
||||||
writeln('Hidden');
|
DebugLn('Hidden');
|
||||||
exit;
|
exit;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
writeln(format('other changes state=%.08x mask=%.08x',[AState,msk]));
|
DebugLn(format('other changes state=%.08x mask=%.08x',[AState,msk]));
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -67,13 +67,13 @@ function TGtk3WidgetSet.BitBlt(DestDC: HDC; X, Y, Width, Height: Integer;
|
|||||||
SrcDC: HDC; XSrc, YSrc: Integer; Rop: DWORD): Boolean;
|
SrcDC: HDC; XSrc, YSrc: Integer; Rop: DWORD): Boolean;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseGtk3DeviceContext}
|
{$ifdef VerboseGtk3DeviceContext}
|
||||||
WriteLn('Trace:> [TGtk3WidgetSet.BitBlt]');
|
DebugLn('Trace:> [TGtk3WidgetSet.BitBlt]');
|
||||||
{$endif}
|
{$endif}
|
||||||
Result := StretchBlt(DestDC, X, Y, Width, Height, SrcDC, XSrc, YSrc, Width,
|
Result := StretchBlt(DestDC, X, Y, Width, Height, SrcDC, XSrc, YSrc, Width,
|
||||||
Height, ROP);
|
Height, ROP);
|
||||||
|
|
||||||
{$ifdef VerboseGtk3DeviceContext}
|
{$ifdef VerboseGtk3DeviceContext}
|
||||||
WriteLn('Trace:< [TGtk3WidgetSet.BitBlt]');
|
DebugLn('Trace:< [TGtk3WidgetSet.BitBlt]');
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -177,10 +177,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string): TClipboardFormat;
|
function TGtk3WidgetSet.ClipboardRegisterFormat(const AMimeType: string): TClipboardFormat;
|
||||||
|
var xGA:PGdkAtom;
|
||||||
begin
|
begin
|
||||||
if Assigned(Application) then
|
if Assigned(Application) then
|
||||||
Result := {%H-}TClipboardFormat(TGdkAtom.intern(PChar(AMimeType), False))
|
begin
|
||||||
else
|
xGA:=TGdkAtom.intern(PChar(AMimeType), False);
|
||||||
|
Result := TClipboardFormat(xGA);
|
||||||
|
end else
|
||||||
RaiseGDBException(
|
RaiseGDBException(
|
||||||
'ERROR: TGtk3WidgetSet.ClipboardRegisterFormat gdk not initialized');
|
'ERROR: TGtk3WidgetSet.ClipboardRegisterFormat gdk not initialized');
|
||||||
end;
|
end;
|
||||||
@ -223,7 +226,7 @@ begin
|
|||||||
RGN_COPY:
|
RGN_COPY:
|
||||||
begin
|
begin
|
||||||
AStatus := cairo_region_intersect(RDest, RSrc1);
|
AStatus := cairo_region_intersect(RDest, RSrc1);
|
||||||
// writeln('CombineRgn RGN_COPY ',AStatus);
|
//DebugLn(['CombineRgn RGN_COPY ',AStatus]);
|
||||||
end;
|
end;
|
||||||
RGN_DIFF:
|
RGN_DIFF:
|
||||||
begin
|
begin
|
||||||
@ -726,7 +729,7 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
Gtk3WordWrap(DC, PChar(AStr), MaxWidth, Lines, NumLines);
|
Gtk3WordWrap(DC, PChar(AStr), MaxWidth, Lines, NumLines);
|
||||||
// writeln('WORD WRAP RESULTED IN ',NumLines,' lines for ',AStr,' MAX=',MaxWidth);
|
//DebugLn(['WORD WRAP RESULTED IN ',NumLines,' lines for ',AStr,' MAX=',MaxWidth]);
|
||||||
if (Flags and DT_CALCRECT)<>0 then
|
if (Flags and DT_CALCRECT)<>0 then
|
||||||
begin
|
begin
|
||||||
LineWidth := 0;
|
LineWidth := 0;
|
||||||
@ -752,7 +755,8 @@ var
|
|||||||
if NumLines>1 then
|
if NumLines>1 then
|
||||||
Inc(theRect.Bottom, (NumLines-1)*TM.tmDescent);// space between lines
|
Inc(theRect.Bottom, (NumLines-1)*TM.tmDescent);// space between lines
|
||||||
|
|
||||||
// debugln('TGtk3WidgetSet.DrawText A ',dbgs(theRect),' TM.tmHeight=',dbgs(TM.tmHeight),' LineWidth=',dbgs(LineWidth),' NumLines=',dbgs(NumLines));
|
//DebugLn('TGtk3WidgetSet.DrawText A ',dbgs(theRect),' TM.tmHeight=',dbgs(TM.tmHeight),
|
||||||
|
// ' LineWidth=',dbgs(LineWidth),' NumLines=',dbgs(NumLines));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not CalcRect then
|
if not CalcRect then
|
||||||
@ -812,7 +816,6 @@ var
|
|||||||
|
|
||||||
function NeedOffsetCalc: Boolean;
|
function NeedOffsetCalc: Boolean;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
Result := (TGtk3DeviceContext(DC).CurrentFont.LogFont.lfOrientation <> 0) and
|
Result := (TGtk3DeviceContext(DC).CurrentFont.LogFont.lfOrientation <> 0) and
|
||||||
(Flags and DT_SINGLELINE <> 0) and
|
(Flags and DT_SINGLELINE <> 0) and
|
||||||
(Flags and DT_VCENTER = 0) and (Flags and DT_CENTER = 0) and
|
(Flags and DT_VCENTER = 0) and (Flags and DT_CENTER = 0) and
|
||||||
@ -1264,8 +1267,8 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := 0;
|
Result := 0;
|
||||||
{$ifdef VerboseEnumFonts}
|
{$ifdef VerboseEnumFonts}
|
||||||
WriteLn('[TGtk3WidgetSet.EnumFontFamiliesEx] Charset=',lpLogFont^.lfCharSet,
|
DebugLn(['[TGtk3WidgetSet.EnumFontFamiliesEx] Charset=',lpLogFont^.lfCharSet,
|
||||||
' face ',lpLogFont^.lfFaceName,' pitchAndFamily=',lpLogFont^.lfPitchAndFamily);
|
' face ',lpLogFont^.lfFaceName,' pitchAndFamily=',lpLogFont^.lfPitchAndFamily]);
|
||||||
{$endif}
|
{$endif}
|
||||||
Result := 0;
|
Result := 0;
|
||||||
Metric.ntmentm.ntmAvgWidth := 0; // just to shutup compiler
|
Metric.ntmentm.ntmAvgWidth := 0; // just to shutup compiler
|
||||||
@ -1475,9 +1478,9 @@ begin
|
|||||||
|
|
||||||
// get transformation
|
// get transformation
|
||||||
GetWindowOrgEx(DC, @DCOrigin);
|
GetWindowOrgEx(DC, @DCOrigin);
|
||||||
// writeln('ExtSelectClipRgn DCOrigin=',dbgs(DCOrigin),' R=',dbgs(R));
|
// DebugLn('ExtSelectClipRgn DCOrigin=',dbgs(DCOrigin),' R=',dbgs(R));
|
||||||
// OffsetRect(R, -DCOrigin.X, -DCOrigin.Y);
|
// OffsetRect(R, -DCOrigin.X, -DCOrigin.Y);
|
||||||
// writeln('ExtSelectClipRgn after DCOrigin=',dbgs(DCOrigin),' R=',dbgs(R));
|
// DebugLn('ExtSelectClipRgn after DCOrigin=',dbgs(DCOrigin),' R=',dbgs(R));
|
||||||
Clip := CreateRectRGN(0, 0, R.Right - R.Left, R.Bottom - R.Top);
|
Clip := CreateRectRGN(0, 0, R.Right - R.Left, R.Bottom - R.Top);
|
||||||
|
|
||||||
cairo_region_translate(TGtk3Region(Clip).Handle, -DCOrigin.X, -DCOrigin.Y);
|
cairo_region_translate(TGtk3Region(Clip).Handle, -DCOrigin.X, -DCOrigin.Y);
|
||||||
@ -2222,7 +2225,7 @@ begin
|
|||||||
if not IsValidGDIObject(GDIObj) then
|
if not IsValidGDIObject(GDIObj) then
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseGtk3WinAPI}
|
{$ifdef VerboseGtk3WinAPI}
|
||||||
WriteLn('Trace:< TGtk3WidgetSet.GetObject Invalid GDI Object');
|
DebugLn('Trace:< TGtk3WidgetSet.GetObject Invalid GDI Object');
|
||||||
{$endif}
|
{$endif}
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
@ -2438,7 +2441,7 @@ end;
|
|||||||
function TGtk3WidgetSet.GetSysColor(nIndex: Integer): DWORD;
|
function TGtk3WidgetSet.GetSysColor(nIndex: Integer): DWORD;
|
||||||
begin
|
begin
|
||||||
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
|
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
|
||||||
writeln('TGtk3WidgetSet.GetSysColor WARNING: SOME SYSCOLORS ARE STILL HARDCODED nIndex=',nIndex);
|
DebugLn(['TGtk3WidgetSet.GetSysColor WARNING: SOME SYSCOLORS ARE STILL HARDCODED nIndex=',nIndex]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if (nIndex = COLOR_WINDOW) or (nIndex = COLOR_WINDOWTEXT) or
|
if (nIndex = COLOR_WINDOW) or (nIndex = COLOR_WINDOWTEXT) or
|
||||||
(nIndex = COLOR_HIGHLIGHT) or (nIndex = COLOR_HIGHLIGHTTEXT) then
|
(nIndex = COLOR_HIGHLIGHT) or (nIndex = COLOR_HIGHLIGHTTEXT) then
|
||||||
@ -2715,7 +2718,7 @@ begin
|
|||||||
if not IsValidDC(DC) and (P <> nil) then
|
if not IsValidDC(DC) and (P <> nil) then
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseGtk3WinAPI}
|
{$ifdef VerboseGtk3WinAPI}
|
||||||
WriteLn('Trace: < [WinAPI GetWindowOrgEx] No valid DC or P is nil');
|
DebugLn('Trace: < [WinAPI GetWindowOrgEx] No valid DC or P is nil');
|
||||||
{$endif}
|
{$endif}
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -3373,15 +3376,12 @@ begin
|
|||||||
if IsValidHandle(AHandle) then
|
if IsValidHandle(AHandle) then
|
||||||
begin
|
begin
|
||||||
TGtk3Widget(AHandle).SetCapture;
|
TGtk3Widget(AHandle).SetCapture;
|
||||||
//if (Result <> 0) then
|
Message.Msg := 0;
|
||||||
begin
|
FillChar(Message, SizeOf(Message), 0);
|
||||||
Message.Msg := 0;
|
Message.msg := LM_CAPTURECHANGED;
|
||||||
FillChar(Message, SizeOf(Message), 0);
|
Message.wParam := 0;
|
||||||
Message.msg := LM_CAPTURECHANGED;
|
Message.lParam := PtrInt(Result);
|
||||||
Message.wParam := 0;
|
LCLMessageGlue.DeliverMessage(TGtk3Widget(AHandle).LCLObject, Message);
|
||||||
Message.lParam := PtrInt(Result);
|
|
||||||
LCLMessageGlue.DeliverMessage(TGtk3Widget(AHandle).LCLObject, Message);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
}
|
}
|
||||||
unit Gtk3WSCheckLst;
|
unit Gtk3WSCheckLst;
|
||||||
|
|
||||||
{$i gtk3defines.inc}
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$i gtk3defines.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
@ -544,7 +544,7 @@ begin
|
|||||||
NewPos := v - DeltaY;
|
NewPos := v - DeltaY;
|
||||||
if NewPos < 0 then
|
if NewPos < 0 then
|
||||||
NewPos := 0;
|
NewPos := 0;
|
||||||
// writeln('OldValue ',dbgs(V),' NewValue ',dbgs(NewPos),' upper=',dbgs(Adjustment^.upper - Adjustment^.page_size));
|
//DebugLn('OldValue ',dbgs(V),' NewValue ',dbgs(NewPos),' upper=',dbgs(Adjustment^.upper - Adjustment^.page_size));
|
||||||
gtk_adjustment_set_value(Adjustment, NewPos);
|
gtk_adjustment_set_value(Adjustment, NewPos);
|
||||||
end;
|
end;
|
||||||
AWinControl.Invalidate;
|
AWinControl.Invalidate;
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
}
|
}
|
||||||
unit Gtk3WSDialogs;
|
unit Gtk3WSDialogs;
|
||||||
|
|
||||||
{$I gtk3defines.inc}
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$I gtk3defines.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -60,11 +60,11 @@ type
|
|||||||
TGtk3WSOpenDialog = class(TWSOpenDialog)
|
TGtk3WSOpenDialog = class(TWSOpenDialog)
|
||||||
protected
|
protected
|
||||||
class function CreateOpenDialogFilter(OpenDialog: TOpenDialog;
|
class function CreateOpenDialogFilter(OpenDialog: TOpenDialog;
|
||||||
Chooser: PGtkFileChooser): string;
|
Chooser: PGtkFileChooser): string; virtual;
|
||||||
class procedure CreateOpenDialogHistory(OpenDialog: TOpenDialog;
|
class procedure CreateOpenDialogHistory(OpenDialog: TOpenDialog;
|
||||||
SelWidget: PGtkWidget);
|
SelWidget: PGtkWidget); virtual;
|
||||||
class procedure CreatePreviewDialogControl(PreviewDialog: TPreviewFileDialog;
|
class procedure CreatePreviewDialogControl(PreviewDialog: TPreviewFileDialog;
|
||||||
Chooser: PGtkFileChooser);
|
Chooser: PGtkFileChooser); virtual;
|
||||||
published
|
published
|
||||||
class function CreateHandle(const ACommonDialog: TCommonDialog): THandle; override;
|
class function CreateHandle(const ACommonDialog: TCommonDialog): THandle; override;
|
||||||
end;
|
end;
|
||||||
@ -243,7 +243,7 @@ var
|
|||||||
CurDesc:=CurDesc+' ';
|
CurDesc:=CurDesc+' ';
|
||||||
CurDesc:=CurDesc+'('+Masks[i]+')';
|
CurDesc:=CurDesc+'('+Masks[i]+')';
|
||||||
end;
|
end;
|
||||||
//debugln('AddEntries ',CurDesc,' ',Masks[i]);
|
//DebugLn('AddEntries ',CurDesc,' ',Masks[i]);
|
||||||
AddEntry(CurDesc,Masks[i]);
|
AddEntry(CurDesc,Masks[i]);
|
||||||
end;
|
end;
|
||||||
inc(CurFilterIndex);
|
inc(CurFilterIndex);
|
||||||
@ -559,7 +559,7 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
DebugLn('Gtk3WSDialogs: WARNING gtkDialogSelectRowCB is not implemented since PGtkFileSelection is deprecated.');
|
DebugLn('Gtk3WSDialogs: WARNING gtkDialogSelectRowCB is not implemented since PGtkFileSelection is deprecated.');
|
||||||
(*
|
(*
|
||||||
//debugln('GTKDialogSelectRowCB A ');
|
//DebugLn('GTKDialogSelectRowCB A ');
|
||||||
Result:=CallBackDefaultReturn;
|
Result:=CallBackDefaultReturn;
|
||||||
if (Data=nil) or (BEvent=nil) or (Column=0) or (Row=0) then ;
|
if (Data=nil) or (BEvent=nil) or (Column=0) or (Row=0) then ;
|
||||||
theDialog:=TCommonDialog(GetLCLObject(Widget));
|
theDialog:=TCommonDialog(GetLCLObject(Widget));
|
||||||
@ -823,9 +823,9 @@ begin
|
|||||||
FontName := gtk_font_chooser_get_font(PGtkFontChooser(FPointer));
|
FontName := gtk_font_chooser_get_font(PGtkFontChooser(FPointer));
|
||||||
// FontName := gtk_font_selection_dialog_get_font_name(
|
// FontName := gtk_font_selection_dialog_get_font_name(
|
||||||
// pgtkfontselectiondialog(FPointer));
|
// pgtkfontselectiondialog(FPointer));
|
||||||
//debugln('gtkDialogOKclickedCB FontName=',FontName);
|
//DebugLn('gtkDialogOKclickedCB FontName=',FontName);
|
||||||
//SelectedFont:=gdk_font_load(PChar(FontName));
|
//SelectedFont:=gdk_font_load(PChar(FontName));
|
||||||
//debugln('gtkDialogOKclickedCB ',dbgs(SelectedFont));
|
//DebugLn('gtkDialogOKclickedCB ',dbgs(SelectedFont));
|
||||||
|
|
||||||
if IsFontNameXLogicalFontDesc(FontName) then
|
if IsFontNameXLogicalFontDesc(FontName) then
|
||||||
begin
|
begin
|
||||||
@ -982,7 +982,7 @@ end;
|
|||||||
function GTKDialogKeyUpDownCB(Widget: PGtkWidget; Event : pgdkeventkey;
|
function GTKDialogKeyUpDownCB(Widget: PGtkWidget; Event : pgdkeventkey;
|
||||||
Data: gPointer) : GBoolean; cdecl;
|
Data: gPointer) : GBoolean; cdecl;
|
||||||
begin
|
begin
|
||||||
//debugln('GTKDialogKeyUpDownCB A ');
|
//DebugLn('GTKDialogKeyUpDownCB A ');
|
||||||
Result := False;
|
Result := False;
|
||||||
(*
|
(*
|
||||||
if (Widget=nil) then ;
|
if (Widget=nil) then ;
|
||||||
@ -1016,7 +1016,7 @@ function GTKDialogFocusInCB(widget: PGtkWidget; data: gPointer): GBoolean;
|
|||||||
var
|
var
|
||||||
theDialog: TCommonDialog;
|
theDialog: TCommonDialog;
|
||||||
begin
|
begin
|
||||||
//debugln('GTKDialogFocusInCB A ');
|
//DebugLn('GTKDialogFocusInCB A ');
|
||||||
Result := False;
|
Result := False;
|
||||||
if (Data=nil) then ;
|
if (Data=nil) then ;
|
||||||
(*
|
(*
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
unit Gtk3WSExtCtrls;
|
unit Gtk3WSExtCtrls;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
{$I gtk3defines.inc}
|
{$I gtk3defines.inc}
|
||||||
|
|
||||||
|
@ -14,8 +14,9 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
unit Gtk3WSForms;
|
unit Gtk3WSForms;
|
||||||
{$i gtk3defines.inc}
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$i gtk3defines.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
}
|
}
|
||||||
unit Gtk3WSMenus;
|
unit Gtk3WSMenus;
|
||||||
|
|
||||||
{$i gtk3defines.inc}
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$i gtk3defines.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ begin
|
|||||||
if ((not AMenuItem.Parent.HasParent) and (AMenuItem.GetParentMenu is TMainMenu)) then
|
if ((not AMenuItem.Parent.HasParent) and (AMenuItem.GetParentMenu is TMainMenu)) then
|
||||||
begin
|
begin
|
||||||
AForm := TCustomForm(AMenuItem.GetParentMenu.Owner);
|
AForm := TCustomForm(AMenuItem.GetParentMenu.Owner);
|
||||||
PGtkMenuBar(TGtk3Window(AForm.Handle).GetMenuBar)^.append(TGtk3MenuItem(AMenuItem.Handle).Widget);
|
PGtkMenuBar(TGtk3Window(AForm.Handle).GetMenuBar)^.append(PGtkMenuItem(AMenuItem.Handle){.Widget});
|
||||||
end else
|
end else
|
||||||
(*
|
(*
|
||||||
if (AMenuItem.GetParentMenu is TPopupMenu) then
|
if (AMenuItem.GetParentMenu is TPopupMenu) then
|
||||||
@ -332,7 +332,7 @@ begin
|
|||||||
ContainerMenu := TGtkMenu.new;
|
ContainerMenu := TGtkMenu.new;
|
||||||
g_object_set_data(ParentMenuWidget, 'ContainerMenu',
|
g_object_set_data(ParentMenuWidget, 'ContainerMenu',
|
||||||
ContainerMenu);
|
ContainerMenu);
|
||||||
PGTKMenuItem(ParentMenuWidget)^.set_submenu(ContainerMenu);
|
PGTKMenuItem(ParentMenuWidget)^.set_submenu(PGtkMenu(ContainerMenu));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
PGtkMenu(ContainerMenu)^.insert(MenuItem.Widget, AMenuItem.MenuVisibleIndex);
|
PGtkMenu(ContainerMenu)^.insert(MenuItem.Widget, AMenuItem.MenuVisibleIndex);
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
unit gtk3wssplitter;
|
{
|
||||||
|
*****************************************************************************
|
||||||
|
This file is part of the Lazarus Component Library (LCL)
|
||||||
|
|
||||||
|
See the file COPYING.modifiedLGPL.txt, included in this distribution,
|
||||||
|
for details about the license.
|
||||||
|
*****************************************************************************
|
||||||
|
}
|
||||||
|
unit Gtk3WSSplitter;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
{$I gtk3defines.inc}
|
{$I gtk3defines.inc}
|
||||||
|
@ -23,7 +23,7 @@ Also refer to discussion in ../gtk2/UnityWSCtrls.pas
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unit gtk3wstrayicon;
|
unit Gtk3WSTrayIcon;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
|
|
||||||
unit interfaces;
|
unit interfaces;
|
||||||
|
|
||||||
{$mode objfpc}
|
{$mode objfpc}{$H+}
|
||||||
{$H+}
|
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user