mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-09 09:58:19 +02:00
gtk2: clean up
git-svn-id: trunk@36790 -
This commit is contained in:
parent
eec588e537
commit
22e37e0981
@ -219,7 +219,7 @@ type
|
|||||||
procedure WordWrap(DC: HDC; AText: PChar; MaxWidthInPixel: integer;
|
procedure WordWrap(DC: HDC; AText: PChar; MaxWidthInPixel: integer;
|
||||||
out Lines: PPChar; out LineCount: integer);
|
out Lines: PPChar; out LineCount: integer);
|
||||||
|
|
||||||
procedure ResizeChild(Sender : TObject; Left,Top,Width,Height : Integer);
|
procedure ResizeChild(Sender : TObject; {%H-}Left,{%H-}Top,{%H-}Width,{%H-}Height : Integer);
|
||||||
procedure RemoveCallbacks(Widget: PGtkWidget);
|
procedure RemoveCallbacks(Widget: PGtkWidget);
|
||||||
|
|
||||||
// for gtk specific components:
|
// for gtk specific components:
|
||||||
@ -281,7 +281,7 @@ type
|
|||||||
procedure AppProcessMessages; override;
|
procedure AppProcessMessages; override;
|
||||||
procedure AppWaitMessage; override;
|
procedure AppWaitMessage; override;
|
||||||
procedure AppTerminate; override;
|
procedure AppTerminate; override;
|
||||||
procedure AppSetTitle(const ATitle: string); override;
|
procedure AppSetTitle(const {%H-}ATitle: string); override;
|
||||||
|
|
||||||
// copied from GtkInt
|
// copied from GtkInt
|
||||||
procedure _SetCallbackEx(const AMsg: LongInt; const AGTKObject: PGTKObject; const ALCLObject: TObject; Direct: Boolean);
|
procedure _SetCallbackEx(const AMsg: LongInt; const AGTKObject: PGTKObject; const ALCLObject: TObject; Direct: Boolean);
|
||||||
|
@ -974,7 +974,7 @@ end;
|
|||||||
procedure MergeClipping(DestinationDC: TGtkDeviceContext; DestinationGC: PGDKGC;
|
procedure MergeClipping(DestinationDC: TGtkDeviceContext; DestinationGC: PGDKGC;
|
||||||
X,Y,Width,Height: integer; ClipMergeMask: PGdkBitmap;
|
X,Y,Width,Height: integer; ClipMergeMask: PGdkBitmap;
|
||||||
ClipMergeMaskX, ClipMergeMaskY: integer;
|
ClipMergeMaskX, ClipMergeMaskY: integer;
|
||||||
var NewClipMask: PGdkBitmap);
|
out NewClipMask: PGdkBitmap);
|
||||||
// merge ClipMergeMask into the destination clipping mask at the
|
// merge ClipMergeMask into the destination clipping mask at the
|
||||||
// destination rectangle
|
// destination rectangle
|
||||||
var
|
var
|
||||||
|
@ -619,7 +619,7 @@ procedure SetGCRasterOperation(TheGC: PGDKGC; Rop: Cardinal);
|
|||||||
procedure MergeClipping(DestinationDC: TGtkDeviceContext; DestinationGC: PGDKGC;
|
procedure MergeClipping(DestinationDC: TGtkDeviceContext; DestinationGC: PGDKGC;
|
||||||
X,Y,Width,Height: integer; ClipMergeMask: PGdkBitmap;
|
X,Y,Width,Height: integer; ClipMergeMask: PGdkBitmap;
|
||||||
ClipMergeMaskX, ClipMergeMaskY: integer;
|
ClipMergeMaskX, ClipMergeMaskY: integer;
|
||||||
var NewClipMask: PGdkBitmap);
|
out NewClipMask: PGdkBitmap);
|
||||||
function CreatePixbufFromImageAndMask(ASrc: PGdkDrawable; ASrcX, ASrcY, ASrcWidth,
|
function CreatePixbufFromImageAndMask(ASrc: PGdkDrawable; ASrcX, ASrcY, ASrcWidth,
|
||||||
ASrcHeight: integer; ASrcColorMap: PGdkColormap; ASrcMask: PGdkBitmap): PGdkPixbuf;
|
ASrcHeight: integer; ASrcColorMap: PGdkColormap; ASrcMask: PGdkBitmap): PGdkPixbuf;
|
||||||
function ScalePixmapAndMask({%H-}AScaleGC: PGDKGC; AScaleMethod: TGdkInterpType;
|
function ScalePixmapAndMask({%H-}AScaleGC: PGDKGC; AScaleMethod: TGdkInterpType;
|
||||||
|
@ -215,7 +215,7 @@ end;
|
|||||||
procedure TGtk2ThemeServices.InternalDrawParentBackground(Window: HWND;
|
procedure TGtk2ThemeServices.InternalDrawParentBackground(Window: HWND;
|
||||||
Target: HDC; Bounds: PRect);
|
Target: HDC; Bounds: PRect);
|
||||||
begin
|
begin
|
||||||
// ?
|
// ToDo: TGtk2ThemeServices.InternalDrawParentBackground: What to do?
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGtk2ThemeServices.GetBaseDetailsSize(Details: TThemedElementDetails): TSize;
|
function TGtk2ThemeServices.GetBaseDetailsSize(Details: TThemedElementDetails): TSize;
|
||||||
|
@ -1296,8 +1296,8 @@ var
|
|||||||
threadsync_giochannel: pgiochannel;
|
threadsync_giochannel: pgiochannel;
|
||||||
childsig_pending: boolean;
|
childsig_pending: boolean;
|
||||||
|
|
||||||
procedure ChildEventHandler(sig: longint; siginfo: psiginfo;
|
procedure ChildEventHandler({%H-}sig: longint; {%H-}siginfo: psiginfo;
|
||||||
sigcontext: psigcontext); cdecl;
|
{%H-}sigcontext: psigcontext); cdecl;
|
||||||
begin
|
begin
|
||||||
childsig_pending := true;
|
childsig_pending := true;
|
||||||
WakeMainThread(nil);
|
WakeMainThread(nil);
|
||||||
@ -1746,6 +1746,8 @@ procedure TGtk2WidgetSet.PrepareSynchronize(AObject: TObject);
|
|||||||
var
|
var
|
||||||
thrash: char;
|
thrash: char;
|
||||||
begin
|
begin
|
||||||
|
// ToDo: TGtk2WidgetSet.PrepareSynchronize what is AObject?
|
||||||
|
|
||||||
// wake up GUI thread by sending a byte through the threadsync pipe
|
// wake up GUI thread by sending a byte through the threadsync pipe
|
||||||
thrash:='l';
|
thrash:='l';
|
||||||
fpwrite(threadsync_pipeout, thrash, 1);
|
fpwrite(threadsync_pipeout, thrash, 1);
|
||||||
@ -1760,6 +1762,7 @@ var
|
|||||||
handler: PChildSignalEventHandler;
|
handler: PChildSignalEventHandler;
|
||||||
begin
|
begin
|
||||||
repeat
|
repeat
|
||||||
|
status:=0;
|
||||||
pid := fpwaitpid(-1, status, WNOHANG);
|
pid := fpwaitpid(-1, status, WNOHANG);
|
||||||
if pid <= 0 then break;
|
if pid <= 0 then break;
|
||||||
if wifexited(status) then
|
if wifexited(status) then
|
||||||
@ -1793,7 +1796,7 @@ var
|
|||||||
thrashspace: array[1..1024] of byte;
|
thrashspace: array[1..1024] of byte;
|
||||||
begin
|
begin
|
||||||
// read the sent bytes
|
// read the sent bytes
|
||||||
fpread(threadsync_pipein, thrashspace[1], 1);
|
fpread(threadsync_pipein, {%H-}thrashspace[1], 1);
|
||||||
|
|
||||||
Result := true;
|
Result := true;
|
||||||
// one of children signaled ?
|
// one of children signaled ?
|
||||||
@ -2610,7 +2613,7 @@ end;
|
|||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
procedure TGtk2WidgetSet.AppSetTitle(const ATitle: string);
|
procedure TGtk2WidgetSet.AppSetTitle(const ATitle: string);
|
||||||
begin
|
begin
|
||||||
|
// ToDo: TGtk2WidgetSet.AppSetTitle: has a gtk2 application such a thing?
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -2780,7 +2783,7 @@ begin
|
|||||||
//DebugLn('trace:[TGtk2WidgetSet.InternalGetDIBits]');
|
//DebugLn('trace:[TGtk2WidgetSet.InternalGetDIBits]');
|
||||||
|
|
||||||
Result := 0;
|
Result := 0;
|
||||||
FillByte(BitInfo,SizeOf(BitInfo),0);
|
FillByte(BitInfo{%H-},SizeOf(BitInfo),0);
|
||||||
|
|
||||||
if (DC=0) or (Usage=0) then ;
|
if (DC=0) or (Usage=0) then ;
|
||||||
if not IsValidGDIObject(Bitmap)
|
if not IsValidGDIObject(Bitmap)
|
||||||
|
@ -153,9 +153,9 @@ type
|
|||||||
class procedure ColumnSetAlignment(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AAlignment: TAlignment); override;
|
class procedure ColumnSetAlignment(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AAlignment: TAlignment); override;
|
||||||
class procedure ColumnSetAutoSize(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AAutoSize: Boolean); override;
|
class procedure ColumnSetAutoSize(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AAutoSize: Boolean); override;
|
||||||
class procedure ColumnSetCaption(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const ACaption: String); override;
|
class procedure ColumnSetCaption(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const ACaption: String); override;
|
||||||
class procedure ColumnSetImage(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AImageIndex: Integer); override;
|
class procedure ColumnSetImage(const ALV: TCustomListView; const {%H-}AIndex: Integer; const {%H-}AColumn: TListColumn; const {%H-}AImageIndex: Integer); override;
|
||||||
class procedure ColumnSetMaxWidth(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AMaxWidth: Integer); override;
|
class procedure ColumnSetMaxWidth(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AMaxWidth: Integer); override;
|
||||||
class procedure ColumnSetMinWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AMinWidth: integer); override;
|
class procedure ColumnSetMinWidth(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AMinWidth: integer); override;
|
||||||
class procedure ColumnSetWidth(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AWidth: Integer); override;
|
class procedure ColumnSetWidth(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AWidth: Integer); override;
|
||||||
class procedure ColumnSetVisible(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AVisible: Boolean); override;
|
class procedure ColumnSetVisible(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AVisible: Boolean); override;
|
||||||
|
|
||||||
@ -167,13 +167,13 @@ type
|
|||||||
class function ItemGetChecked(const {%H-}ALV: TCustomListView; const {%H-}AIndex: Integer; const AItem: TListItem): Boolean; override;
|
class function ItemGetChecked(const {%H-}ALV: TCustomListView; const {%H-}AIndex: Integer; const AItem: TListItem): Boolean; override;
|
||||||
class function ItemGetState(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AItem: TListItem; const AState: TListItemState; out AIsSet: Boolean): Boolean; override; // returns True if supported
|
class function ItemGetState(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AItem: TListItem; const AState: TListItemState; out AIsSet: Boolean): Boolean; override; // returns True if supported
|
||||||
class procedure ItemInsert(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AItem: TListItem); override;
|
class procedure ItemInsert(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AItem: TListItem); override;
|
||||||
class procedure ItemSetChecked(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const AChecked: Boolean); override;
|
class procedure ItemSetChecked(const ALV: TCustomListView; const {%H-}AIndex: Integer; const {%H-}AItem: TListItem; const {%H-}AChecked: Boolean); override;
|
||||||
class procedure ItemSetImage(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AItem: TListItem; const {%H-}ASubIndex, AImageIndex: Integer); override;
|
class procedure ItemSetImage(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AItem: TListItem; const {%H-}ASubIndex, AImageIndex: Integer); override;
|
||||||
class procedure ItemSetState(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AItem: TListItem; const AState: TListItemState; const AIsSet: Boolean); override;
|
class procedure ItemSetState(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AItem: TListItem; const AState: TListItemState; const AIsSet: Boolean); override;
|
||||||
class procedure ItemSetText(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const ASubIndex: Integer; const AText: String); override;
|
class procedure ItemSetText(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const ASubIndex: Integer; const AText: String); override;
|
||||||
class procedure ItemShow(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const PartialOK: Boolean); override;
|
class procedure ItemShow(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const PartialOK: Boolean); override;
|
||||||
class function ItemGetPosition(const ALV: TCustomListView; const AIndex: Integer): TPoint; override;
|
class function ItemGetPosition(const ALV: TCustomListView; const AIndex: Integer): TPoint; override;
|
||||||
class procedure ItemUpdate(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem); override;
|
class procedure ItemUpdate(const ALV: TCustomListView; const {%H-}AIndex: Integer; const AItem: TListItem); override;
|
||||||
|
|
||||||
// lv
|
// lv
|
||||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
||||||
|
@ -69,11 +69,17 @@ var
|
|||||||
begin
|
begin
|
||||||
// DebugLn('Gtk2_ItemFocusChanged');
|
// DebugLn('Gtk2_ItemFocusChanged');
|
||||||
// the defocus of the oldrow isn't send
|
// the defocus of the oldrow isn't send
|
||||||
if GTK_IS_TREE_VIEW(Widget) then
|
if GTK_IS_TREE_VIEW(Widget) then begin
|
||||||
gtk_tree_view_get_cursor(PGtkTreeView(Widget), path, column)
|
path:=nil;
|
||||||
|
column:=nil;
|
||||||
|
gtk_tree_view_get_cursor(PGtkTreeView(Widget), path, column);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if GTK_IS_ICON_VIEW(Widget) then
|
if GTK_IS_ICON_VIEW(Widget) then begin
|
||||||
gtk_icon_view_get_cursor(PGtkIconView(Widget), path, cell)
|
path:=nil;
|
||||||
|
cell:=nil;
|
||||||
|
gtk_icon_view_get_cursor(PGtkIconView(Widget), path, cell);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
path := nil;
|
path := nil;
|
||||||
|
|
||||||
@ -920,6 +926,7 @@ begin
|
|||||||
if not WSCheckHandleAllocated(ALV, 'ColumnSetImage')
|
if not WSCheckHandleAllocated(ALV, 'ColumnSetImage')
|
||||||
then Exit;
|
then Exit;
|
||||||
|
|
||||||
|
// ToDo: TGtk2WSCustomListView.ColumnSetImage
|
||||||
//DebugLn('TODO: Gtk2. TGtk2WSCustomListView.ColumnSetImage');
|
//DebugLn('TODO: Gtk2. TGtk2WSCustomListView.ColumnSetImage');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1178,8 +1185,11 @@ begin
|
|||||||
|
|
||||||
lisFocused:
|
lisFocused:
|
||||||
begin
|
begin
|
||||||
if GTK_IS_TREE_VIEW(MainView) then
|
if GTK_IS_TREE_VIEW(MainView) then begin
|
||||||
|
Path:=nil;
|
||||||
|
Column:=nil;
|
||||||
gtk_tree_view_get_cursor(PGtkTreeView(MainView), Path, Column)
|
gtk_tree_view_get_cursor(PGtkTreeView(MainView), Path, Column)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if GTK_IS_ICON_VIEW(MainView) then
|
if GTK_IS_ICON_VIEW(MainView) then
|
||||||
gtk_icon_view_get_cursor(PGtkIconView(MainView), Path, Cell{%H-})
|
gtk_icon_view_get_cursor(PGtkIconView(MainView), Path, Cell{%H-})
|
||||||
@ -1245,7 +1255,7 @@ class procedure TGtk2WSCustomListView.ItemSetChecked(
|
|||||||
begin
|
begin
|
||||||
if not WSCheckHandleAllocated(ALV, 'ItemSetChecked')
|
if not WSCheckHandleAllocated(ALV, 'ItemSetChecked')
|
||||||
then Exit;
|
then Exit;
|
||||||
// nothing neede here
|
// nothing needed here
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TGtk2WSCustomListView.ItemSetImage(const ALV: TCustomListView;
|
class procedure TGtk2WSCustomListView.ItemSetImage(const ALV: TCustomListView;
|
||||||
@ -1452,6 +1462,8 @@ var
|
|||||||
Path: PGtkTreePath;
|
Path: PGtkTreePath;
|
||||||
ItemRect: TGdkRectangle;
|
ItemRect: TGdkRectangle;
|
||||||
begin
|
begin
|
||||||
|
// ToDo: TGtk2WSCustomListView.ItemSetText: this function queues a draw. Is this correct?
|
||||||
|
|
||||||
if not WSCheckHandleAllocated(ALV, 'ItemSetText')
|
if not WSCheckHandleAllocated(ALV, 'ItemSetText')
|
||||||
then Exit;
|
then Exit;
|
||||||
|
|
||||||
@ -1485,7 +1497,7 @@ begin
|
|||||||
if not WSCheckHandleAllocated(ALV, 'ItemShow')
|
if not WSCheckHandleAllocated(ALV, 'ItemShow')
|
||||||
then Exit;
|
then Exit;
|
||||||
|
|
||||||
//TODO check for partial visiblity. currently scrolls to the Item to make it fully visible
|
// TODO: TGtk2WSCustomListView.ItemShow check for partial visiblity. currently scrolls to the Item to make it fully visible
|
||||||
StrIndex := IntToStr(AItem.Index);
|
StrIndex := IntToStr(AItem.Index);
|
||||||
|
|
||||||
GetCommonTreeViewWidgets({%H-}PGtkWidget(ALV.Handle), Widgets);
|
GetCommonTreeViewWidgets({%H-}PGtkWidget(ALV.Handle), Widgets);
|
||||||
@ -1722,13 +1734,19 @@ begin
|
|||||||
|
|
||||||
with Widgets^ do
|
with Widgets^ do
|
||||||
begin
|
begin
|
||||||
if GTK_IS_TREE_VIEW(MainView) then
|
if GTK_IS_TREE_VIEW(MainView) then begin
|
||||||
gtk_tree_view_get_cursor(PGtkTreeView(MainView), Path, Column)
|
Path:=nil;
|
||||||
else
|
Column:=nil;
|
||||||
if GTK_IS_ICON_VIEW(MainView) then
|
gtk_tree_view_get_cursor(PGtkTreeView(MainView), Path, Column);
|
||||||
gtk_icon_view_get_cursor(PGtkIconView(MainView), Path, Cell)
|
end
|
||||||
else
|
else begin
|
||||||
Path := nil;
|
if GTK_IS_ICON_VIEW(MainView) then begin
|
||||||
|
Cell:=nil;
|
||||||
|
gtk_icon_view_get_cursor(PGtkIconView(MainView), Path, Cell);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Path := nil;
|
||||||
|
end;
|
||||||
if Path <> nil then
|
if Path <> nil then
|
||||||
begin
|
begin
|
||||||
Result := StrToInt(PChar(Path));
|
Result := StrToInt(PChar(Path));
|
||||||
@ -1785,6 +1803,8 @@ begin
|
|||||||
y := y - cy;
|
y := y - cy;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
ItemPath:=nil;
|
||||||
|
Column:=nil;
|
||||||
if gtk_tree_view_get_path_at_pos(PGtkTreeView(Widgets^.MainView), x, y, ItemPath, Column, nil, nil) then
|
if gtk_tree_view_get_path_at_pos(PGtkTreeView(Widgets^.MainView), x, y, ItemPath, Column, nil, nil) then
|
||||||
begin
|
begin
|
||||||
if ItemPath <> nil then
|
if ItemPath <> nil then
|
||||||
|
Loading…
Reference in New Issue
Block a user