mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 00:02:03 +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;
|
||||
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);
|
||||
|
||||
// for gtk specific components:
|
||||
@ -281,7 +281,7 @@ type
|
||||
procedure AppProcessMessages; override;
|
||||
procedure AppWaitMessage; override;
|
||||
procedure AppTerminate; override;
|
||||
procedure AppSetTitle(const ATitle: string); override;
|
||||
procedure AppSetTitle(const {%H-}ATitle: string); override;
|
||||
|
||||
// copied from GtkInt
|
||||
procedure _SetCallbackEx(const AMsg: LongInt; const AGTKObject: PGTKObject; const ALCLObject: TObject; Direct: Boolean);
|
||||
|
@ -974,7 +974,7 @@ end;
|
||||
procedure MergeClipping(DestinationDC: TGtkDeviceContext; DestinationGC: PGDKGC;
|
||||
X,Y,Width,Height: integer; ClipMergeMask: PGdkBitmap;
|
||||
ClipMergeMaskX, ClipMergeMaskY: integer;
|
||||
var NewClipMask: PGdkBitmap);
|
||||
out NewClipMask: PGdkBitmap);
|
||||
// merge ClipMergeMask into the destination clipping mask at the
|
||||
// destination rectangle
|
||||
var
|
||||
|
@ -619,7 +619,7 @@ procedure SetGCRasterOperation(TheGC: PGDKGC; Rop: Cardinal);
|
||||
procedure MergeClipping(DestinationDC: TGtkDeviceContext; DestinationGC: PGDKGC;
|
||||
X,Y,Width,Height: integer; ClipMergeMask: PGdkBitmap;
|
||||
ClipMergeMaskX, ClipMergeMaskY: integer;
|
||||
var NewClipMask: PGdkBitmap);
|
||||
out NewClipMask: PGdkBitmap);
|
||||
function CreatePixbufFromImageAndMask(ASrc: PGdkDrawable; ASrcX, ASrcY, ASrcWidth,
|
||||
ASrcHeight: integer; ASrcColorMap: PGdkColormap; ASrcMask: PGdkBitmap): PGdkPixbuf;
|
||||
function ScalePixmapAndMask({%H-}AScaleGC: PGDKGC; AScaleMethod: TGdkInterpType;
|
||||
|
@ -215,7 +215,7 @@ end;
|
||||
procedure TGtk2ThemeServices.InternalDrawParentBackground(Window: HWND;
|
||||
Target: HDC; Bounds: PRect);
|
||||
begin
|
||||
// ?
|
||||
// ToDo: TGtk2ThemeServices.InternalDrawParentBackground: What to do?
|
||||
end;
|
||||
|
||||
function TGtk2ThemeServices.GetBaseDetailsSize(Details: TThemedElementDetails): TSize;
|
||||
|
@ -1296,8 +1296,8 @@ var
|
||||
threadsync_giochannel: pgiochannel;
|
||||
childsig_pending: boolean;
|
||||
|
||||
procedure ChildEventHandler(sig: longint; siginfo: psiginfo;
|
||||
sigcontext: psigcontext); cdecl;
|
||||
procedure ChildEventHandler({%H-}sig: longint; {%H-}siginfo: psiginfo;
|
||||
{%H-}sigcontext: psigcontext); cdecl;
|
||||
begin
|
||||
childsig_pending := true;
|
||||
WakeMainThread(nil);
|
||||
@ -1746,6 +1746,8 @@ procedure TGtk2WidgetSet.PrepareSynchronize(AObject: TObject);
|
||||
var
|
||||
thrash: char;
|
||||
begin
|
||||
// ToDo: TGtk2WidgetSet.PrepareSynchronize what is AObject?
|
||||
|
||||
// wake up GUI thread by sending a byte through the threadsync pipe
|
||||
thrash:='l';
|
||||
fpwrite(threadsync_pipeout, thrash, 1);
|
||||
@ -1760,6 +1762,7 @@ var
|
||||
handler: PChildSignalEventHandler;
|
||||
begin
|
||||
repeat
|
||||
status:=0;
|
||||
pid := fpwaitpid(-1, status, WNOHANG);
|
||||
if pid <= 0 then break;
|
||||
if wifexited(status) then
|
||||
@ -1793,7 +1796,7 @@ var
|
||||
thrashspace: array[1..1024] of byte;
|
||||
begin
|
||||
// read the sent bytes
|
||||
fpread(threadsync_pipein, thrashspace[1], 1);
|
||||
fpread(threadsync_pipein, {%H-}thrashspace[1], 1);
|
||||
|
||||
Result := true;
|
||||
// one of children signaled ?
|
||||
@ -2610,7 +2613,7 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TGtk2WidgetSet.AppSetTitle(const ATitle: string);
|
||||
begin
|
||||
|
||||
// ToDo: TGtk2WidgetSet.AppSetTitle: has a gtk2 application such a thing?
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -2780,7 +2783,7 @@ begin
|
||||
//DebugLn('trace:[TGtk2WidgetSet.InternalGetDIBits]');
|
||||
|
||||
Result := 0;
|
||||
FillByte(BitInfo,SizeOf(BitInfo),0);
|
||||
FillByte(BitInfo{%H-},SizeOf(BitInfo),0);
|
||||
|
||||
if (DC=0) or (Usage=0) then ;
|
||||
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 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 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 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 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 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 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 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 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 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
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
||||
|
@ -69,11 +69,17 @@ var
|
||||
begin
|
||||
// DebugLn('Gtk2_ItemFocusChanged');
|
||||
// the defocus of the oldrow isn't send
|
||||
if GTK_IS_TREE_VIEW(Widget) then
|
||||
gtk_tree_view_get_cursor(PGtkTreeView(Widget), path, column)
|
||||
if GTK_IS_TREE_VIEW(Widget) then begin
|
||||
path:=nil;
|
||||
column:=nil;
|
||||
gtk_tree_view_get_cursor(PGtkTreeView(Widget), path, column);
|
||||
end
|
||||
else
|
||||
if GTK_IS_ICON_VIEW(Widget) then
|
||||
gtk_icon_view_get_cursor(PGtkIconView(Widget), path, cell)
|
||||
if GTK_IS_ICON_VIEW(Widget) then begin
|
||||
path:=nil;
|
||||
cell:=nil;
|
||||
gtk_icon_view_get_cursor(PGtkIconView(Widget), path, cell);
|
||||
end
|
||||
else
|
||||
path := nil;
|
||||
|
||||
@ -920,6 +926,7 @@ begin
|
||||
if not WSCheckHandleAllocated(ALV, 'ColumnSetImage')
|
||||
then Exit;
|
||||
|
||||
// ToDo: TGtk2WSCustomListView.ColumnSetImage
|
||||
//DebugLn('TODO: Gtk2. TGtk2WSCustomListView.ColumnSetImage');
|
||||
end;
|
||||
|
||||
@ -1178,8 +1185,11 @@ begin
|
||||
|
||||
lisFocused:
|
||||
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)
|
||||
end
|
||||
else
|
||||
if GTK_IS_ICON_VIEW(MainView) then
|
||||
gtk_icon_view_get_cursor(PGtkIconView(MainView), Path, Cell{%H-})
|
||||
@ -1245,7 +1255,7 @@ class procedure TGtk2WSCustomListView.ItemSetChecked(
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ALV, 'ItemSetChecked')
|
||||
then Exit;
|
||||
// nothing neede here
|
||||
// nothing needed here
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSCustomListView.ItemSetImage(const ALV: TCustomListView;
|
||||
@ -1452,6 +1462,8 @@ var
|
||||
Path: PGtkTreePath;
|
||||
ItemRect: TGdkRectangle;
|
||||
begin
|
||||
// ToDo: TGtk2WSCustomListView.ItemSetText: this function queues a draw. Is this correct?
|
||||
|
||||
if not WSCheckHandleAllocated(ALV, 'ItemSetText')
|
||||
then Exit;
|
||||
|
||||
@ -1485,7 +1497,7 @@ begin
|
||||
if not WSCheckHandleAllocated(ALV, 'ItemShow')
|
||||
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);
|
||||
|
||||
GetCommonTreeViewWidgets({%H-}PGtkWidget(ALV.Handle), Widgets);
|
||||
@ -1722,13 +1734,19 @@ begin
|
||||
|
||||
with Widgets^ do
|
||||
begin
|
||||
if GTK_IS_TREE_VIEW(MainView) then
|
||||
gtk_tree_view_get_cursor(PGtkTreeView(MainView), Path, Column)
|
||||
else
|
||||
if GTK_IS_ICON_VIEW(MainView) then
|
||||
gtk_icon_view_get_cursor(PGtkIconView(MainView), Path, Cell)
|
||||
else
|
||||
Path := nil;
|
||||
if GTK_IS_TREE_VIEW(MainView) then begin
|
||||
Path:=nil;
|
||||
Column:=nil;
|
||||
gtk_tree_view_get_cursor(PGtkTreeView(MainView), Path, Column);
|
||||
end
|
||||
else begin
|
||||
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
|
||||
begin
|
||||
Result := StrToInt(PChar(Path));
|
||||
@ -1785,6 +1803,8 @@ begin
|
||||
y := y - cy;
|
||||
end;
|
||||
end;
|
||||
ItemPath:=nil;
|
||||
Column:=nil;
|
||||
if gtk_tree_view_get_path_at_pos(PGtkTreeView(Widgets^.MainView), x, y, ItemPath, Column, nil, nil) then
|
||||
begin
|
||||
if ItemPath <> nil then
|
||||
|
Loading…
Reference in New Issue
Block a user