gtk intf: reduced warnings/notes - use -dVerboseLCLTodos and -dVerboseGtkTodos to see them

git-svn-id: trunk@15422 -
This commit is contained in:
mattias 2008-06-14 12:04:46 +00:00
parent 80961e1ff9
commit e3520a6d50
17 changed files with 47 additions and 45 deletions

View File

@ -483,11 +483,11 @@ begin
ABits := (PB^ shr AShift) and PrecMask; ABits := (PB^ shr AShift) and PrecMask;
end; end;
16: begin 16: begin
{$note check endian and/or source byte order} {$IFDEF VerboseLCLTodos}{$note check endian and/or source byte order}{$ENDIF}
ABits := (PW^ shr AShift) and PrecMask; ABits := (PW^ shr AShift) and PrecMask;
end; end;
32: begin 32: begin
{$note check endian and/or source byte order} {$IFDEF VerboseLCLTodos}{$note check endian and/or source byte order}{$ENDIF}
ABits := (PC^ shr AShift) and PrecMask; ABits := (PC^ shr AShift) and PrecMask;
end; end;
else else
@ -535,12 +535,12 @@ begin
PB^ := (PB^ and PrecMask) or (ABits shl AShift); PB^ := (PB^ and PrecMask) or (ABits shl AShift);
end; end;
16: begin 16: begin
{$note check endian and/or source byte order} {$IFDEF VerboseLCLTodos}{$note check endian and/or source byte order}{$ENDIF}
PrecMask := not(PrecMask shl AShift); PrecMask := not(PrecMask shl AShift);
PW^ := (PW^ and PrecMask) or (ABits shl AShift); PW^ := (PW^ and PrecMask) or (ABits shl AShift);
end; end;
32: begin 32: begin
{$note check endian and/or source byte order} {$IFDEF VerboseLCLTodos}{$note check endian and/or source byte order}{$ENDIF}
PrecMask := not(PrecMask shl AShift); PrecMask := not(PrecMask shl AShift);
PC^ := (PC^ and PrecMask) or (ABits shl AShift); PC^ := (PC^ and PrecMask) or (ABits shl AShift);
end; end;
@ -1035,7 +1035,7 @@ end;
function TRawImage.IsTransparent(ATestPixels: Boolean): Boolean; function TRawImage.IsTransparent(ATestPixels: Boolean): Boolean;
function CheckAlpha: Boolean; function CheckAlpha: Boolean;
begin begin
{$note TODO: implement CheckAlpha} {$IFDEF VerboseLCLTodos}{$note TODO: implement CheckAlpha}{$ENDIF}
Result := True; Result := True;
end; end;
begin begin

View File

@ -473,7 +473,7 @@ end;
function TCustomBitmap.GetTransparent: Boolean; function TCustomBitmap.GetTransparent: Boolean;
begin begin
{$note add better check for transparency } {$IFDEF VerboseLCLTodos}{$note add better check for transparency }{$ENDIF}
// MWE: now tharansparency is set when a maskhandle is assigned, the user can // MWE: now tharansparency is set when a maskhandle is assigned, the user can
// override this by setting it to false, so no mask is used, // override this by setting it to false, so no mask is used,
// however this meganism ignores the possible alpha channel, so for now 32bit // however this meganism ignores the possible alpha channel, so for now 32bit
@ -822,7 +822,7 @@ begin
try try
// read image // read image
IntfImg := TLazIntfImage.Create(0,0); IntfImg := TLazIntfImage.Create(0,0);
{$note set pixelformat based on image, not device} {$IFDEF VerboseLCLTodos}{$note set pixelformat based on image, not device}{$ENDIF}
// add an extention to the reader, so that we h get called after the header is read // add an extention to the reader, so that we h get called after the header is read
// the next will cause that all images are loaded in pfDevice format. // the next will cause that all images are loaded in pfDevice format.
// This is incompatible with delphi // This is incompatible with delphi
@ -924,7 +924,7 @@ begin
if WriterClass=nil if WriterClass=nil
then begin then begin
{$note todo choose the correct writer} {$IFDEF VerboseLCLTodos}{$note todo choose the correct writer}{$ENDIF}
// Bitmaps support alpha. TCustomBitmaps supports more than these 2 formats anyway. // Bitmaps support alpha. TCustomBitmaps supports more than these 2 formats anyway.
// So setting the writer based on a mask is nonsense imo (MWE) // So setting the writer based on a mask is nonsense imo (MWE)
@ -1181,7 +1181,7 @@ begin
Exit; Exit;
end; end;
{$note todo: move to IntfImage} {$IFDEF VerboseLCLTodos}{$note todo: move to IntfImage}{$ENDIF}
IntfImage := TLazIntfImage.Create(0, 0); IntfImage := TLazIntfImage.Create(0, 0);
try try
// load from bitmap needs a mask handle otherwise no mask description is // load from bitmap needs a mask handle otherwise no mask description is

View File

@ -35,9 +35,9 @@ type
fWindow: TWindow; fWindow: TWindow;
fScreenID: longint; fScreenID: longint;
fTrayParent: TWindow; fTrayParent: TWindow;
fOwner: TComponent; //fOwner: TComponent;
fEmbedded: Boolean; fEmbedded: Boolean;
fMsgCount: Integer; //fMsgCount: Integer;
fTrayIcon: TCustomTrayIcon; fTrayIcon: TCustomTrayIcon;
function GetCanvas: TCanvas; function GetCanvas: TCanvas;
function NotifyExpose(Event: PGdkEventExpose; Widget: PGtkWidget): Boolean; cdecl; function NotifyExpose(Event: PGdkEventExpose; Widget: PGtkWidget): Boolean; cdecl;

View File

@ -64,8 +64,8 @@
{$info Compiling with gtk2 for X} {$info Compiling with gtk2 for X}
{$define HasX} {$define HasX}
{$else} {$else}
{$note On darwin the native gtk2 widgetset is used. } {$IFDEF VerboseGtkToDos}{$note On darwin the native gtk2 widgetset is used. }{$ENDIF}
{$note If you want to use gtk2 for X, define UseX } {$IFDEF VerboseGtkToDos}{$note If you want to use gtk2 for X, define UseX }{$ENDIF}
{$endif} {$endif}
{$else} {$else}
{$define HasX} {$define HasX}

View File

@ -285,7 +285,7 @@ begin
FDrawable := AWindow; FDrawable := AWindow;
{$IFDEF Gtk1} {$IFDEF Gtk1}
{$note todo: check if this is still needed} // now gc is a property {$IFDEF VerboseGtkToDos}{$note todo: check if this is still needed}{$ENDIF} // now gc is a property
GetGC; GetGC;
{$ELSE} {$ELSE}
// GC is created on demand // GC is created on demand

View File

@ -112,7 +112,7 @@ type
{$ifdef unix} {$ifdef unix}
FChildSignalHandlers: PChildSignalEventHandler; FChildSignalHandlers: PChildSignalEventHandler;
{$else} {$else}
{$warning no declaration of FChildSignalHandlers for this OS} {$IFDEF VerboseGtkToDos}{$warning no declaration of FChildSignalHandlers for this OS}{$ENDIF}
{$endif} {$endif}
{$Ifdef GTK2} {$Ifdef GTK2}

View File

@ -863,7 +863,7 @@ begin
AHandler := nil; AHandler := nil;
end; end;
{$else} {$else}
{$warning TGtkWidgetSet.RemoveProcessEventHandler and TGtkWidgetSet.AddProcessEventHandler not implemented on this OS} {$IFDEF VerboseGtkToDos}{$warning TGtkWidgetSet.RemoveProcessEventHandler and TGtkWidgetSet.AddProcessEventHandler not implemented on this OS}{$ENDIF}
//PChildSignalEventHandler is only defined on unix //PChildSignalEventHandler is only defined on unix
function TGtkWidgetSet.AddProcessEventHandler(AHandle: THandle; function TGtkWidgetSet.AddProcessEventHandler(AHandle: THandle;
AEventHandler: TChildExitEvent; AData: PtrInt): PProcessEventHandler; AEventHandler: TChildExitEvent; AData: PtrInt): PProcessEventHandler;

View File

@ -37,7 +37,7 @@ begin
TabWidget := gtk_notebook_get_tab_label(PGtkNoteBook(NotebookWidget), TabWidget := gtk_notebook_get_tab_label(PGtkNoteBook(NotebookWidget),
PageWidget); PageWidget);
if TabWidget = nil then exit; if TabWidget = nil then exit;
{$note reimplement} {$IFDEF VerboseGtkToDos}{$note reimplement}{$ENDIF}
DrawImageListIconOnWidget(NoteBook.Images, ImageIndex, Widget); DrawImageListIconOnWidget(NoteBook.Images, ImageIndex, Widget);
end; end;

View File

@ -280,7 +280,7 @@ begin
GdkTrapIsSet:=false; GdkTrapIsSet:=false;
{$note TODO: enable standard error_log handling} {$IFDEF VerboseGtkToDos}{$note TODO: enable standard error_log handling}{$ENDIF}
{$IfDef REPORT_GDK_ERRORS} {$IfDef REPORT_GDK_ERRORS}
If (Xerror<>0) then If (Xerror<>0) then
RaiseGDBException('A GDK/X Error occured, this is normally fatal. The error code was : ' + IntToStr(Xerror)); RaiseGDBException('A GDK/X Error occured, this is normally fatal. The error code was : ' + IntToStr(Xerror));
@ -1226,7 +1226,7 @@ begin
Result := True; Result := True;
end; end;
{$note remove when gtk native imagelist will be ready} {$IFDEF VerboseGtkToDos}{$note remove when gtk native imagelist will be ready}{$ENDIF}
procedure DrawImageListIconOnWidget(ImgList: TCustomImageList; procedure DrawImageListIconOnWidget(ImgList: TCustomImageList;
Index: integer; AEffect: TGraphicsDrawEffect; DestWidget: PGTKWidget; Index: integer; AEffect: TGraphicsDrawEffect; DestWidget: PGTKWidget;
CenterHorizontally, CenterVertically: boolean; CenterHorizontally, CenterVertically: boolean;
@ -3430,7 +3430,7 @@ var
FileSelWidget: PGtkFileSelection; FileSelWidget: PGtkFileSelection;
LCLHistoryMenu: PGTKWidget; LCLHistoryMenu: PGTKWidget;
{$IFDEF Gtk1} {$IFDEF Gtk1}
AFilterEntry: TFileSelFilterEntry; //AFilterEntry: TFileSelFilterEntry;
FilterList: TFPList; // list of TFileSelFilterListEntry FilterList: TFPList; // list of TFileSelFilterListEntry
LCLFilterMenu: PGTKWidget; LCLFilterMenu: PGTKWidget;
{$ENDIF} {$ENDIF}
@ -5901,7 +5901,7 @@ begin
AEffect := gdeNormal; AEffect := gdeNormal;
if AImageIndex < AImageList.Count then if AImageIndex < AImageList.Count then
{$note reimplement} {$IFDEF VerboseGtkToDos}{$note reimplement}{$ENDIF}
DrawImageListIconOnWidget(AImageList, AImageIndex, AEffect, DrawImageListIconOnWidget(AImageList, AImageIndex, AEffect,
Widget, false, false, ALeft, ATop); Widget, false, false, ALeft, ATop);
@ -8249,7 +8249,7 @@ var
begin begin
Result := nil; Result := nil;
{$WARNING ToDo LoadDefaultFontDesc: get a working default pango font description} {$IFDEF VerboseGtkToDos}{$WARNING ToDo LoadDefaultFontDesc: get a working default pango font description}{$ENDIF}
Result := pango_font_description_from_string('sans 12'); Result := pango_font_description_from_string('sans 12');
exit; exit;

View File

@ -1508,7 +1508,7 @@ var
{$ifdef VerboseGdkPixbuf} debugln('DataSourceInitialize B1');{$endif} {$ifdef VerboseGdkPixbuf} debugln('DataSourceInitialize B1');{$endif}
Source := CreatePixbufFromDrawable(Bitmap^.GDIPixmapObject.Image, Bitmap^.Colormap, False, 0, StartScan, 0, 0, Width, StartScan + NumScans); Source := CreatePixbufFromDrawable(Bitmap^.GDIPixmapObject.Image, Bitmap^.Colormap, False, 0, StartScan, 0, 0, Width, StartScan + NumScans);
{$note TODO: Apply alpha based on mask when 32bit mode is added} {$IFDEF VerboseGtkToDos}{$note TODO: Apply alpha based on mask when 32bit mode is added}{$ENDIF}
rowstride := gdk_pixbuf_get_rowstride(Source); rowstride := gdk_pixbuf_get_rowstride(Source);
Pixels := PByte(gdk_pixbuf_get_pixels(Source)); Pixels := PByte(gdk_pixbuf_get_pixels(Source));
@ -2343,7 +2343,7 @@ var
{$ENDIF} {$ENDIF}
// calculate ScaleMethod // calculate ScaleMethod
{$note use SetStretchBltMode(dc, mode) here} {$IFDEF VerboseGtkToDos}{$note use SetStretchBltMode(dc, mode) here}{$ENDIF}
//GDKPixbuf Scaling is not done in the same way as Windows //GDKPixbuf Scaling is not done in the same way as Windows
//but by rights ScaleMethod should really be chosen based //but by rights ScaleMethod should really be chosen based
//on the destination device's internal flag //on the destination device's internal flag
@ -2661,7 +2661,7 @@ begin
' SrcWhole='+dbgs(SrcWholeWidth)+','+dbgs(SrcWholeHeight), ' SrcWhole='+dbgs(SrcWholeWidth)+','+dbgs(SrcWholeHeight),
''); '');
{$ENDIF} {$ENDIF}
{$note use intersectrect here} {$IFDEF VerboseGtkToDos}{$note use intersectrect here}{$ENDIF}
if X >= DstWholeWidth then Exit; if X >= DstWholeWidth then Exit;
if Y >= DstWholeHeight then exit; if Y >= DstWholeHeight then exit;
if X + Width <= 0 then exit; if X + Width <= 0 then exit;
@ -2765,7 +2765,7 @@ begin
end; end;
{$ENDIF} {$ENDIF}
{$note tode remove, earlier checks require drawable <> nil} {$IFDEF VerboseGtkToDos}{$note tode remove, earlier checks require drawable <> nil}{$ENDIF}
if SrcDevContext.Drawable = nil if SrcDevContext.Drawable = nil
then begin then begin
if DstDevContext.Drawable = nil if DstDevContext.Drawable = nil
@ -2979,7 +2979,7 @@ procedure TGtkWidgetSet.SetCallbackEx(const AMsg: LongInt;
end end
else if GtkWidgetIsA(PGtkWidget(gObject),gtk_scrolled_window_get_type) then else if GtkWidgetIsA(PGtkWidget(gObject),gtk_scrolled_window_get_type) then
begin begin
DebugLn(['GetAdjustment ',GetWidgetDebugReport(PGtkWidget(gObject))]); //DebugLn(['GetAdjustment ',GetWidgetDebugReport(PGtkWidget(gObject))]);
Result := PgtkObject(gtk_scrolled_window_get_hadjustment( Result := PgtkObject(gtk_scrolled_window_get_hadjustment(
PGTKScrolledWindow(gObject))); PGTKScrolledWindow(gObject)));
end else end else
@ -3918,7 +3918,7 @@ end;
TGtkWidgetSet ShowHide TGtkWidgetSet ShowHide
*Note: Show or hide a widget *Note: Show or hide a widget
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
{$note TODO: move to wsclass } {$IFDEF VerboseGtkToDos}{$note TODO: move to wsclass }{$ENDIF}
procedure TGtkWidgetSet.ShowHide(Sender : TObject); procedure TGtkWidgetSet.ShowHide(Sender : TObject);
procedure RaiseWrongClass; procedure RaiseWrongClass;

View File

@ -1308,7 +1308,7 @@ begin
Result := 0; Result := 0;
if not IsValidGDIObject(ACursorInfo^.hbmColor) then Exit; if not IsValidGDIObject(ACursorInfo^.hbmColor) then Exit;
{$note TODO: add support for mono cursors} {$IFDEF VerboseGtkToDos}{$note TODO: add support for mono cursors}{$ENDIF}
Img := PGDIObject(ACursorInfo^.hbmColor)^.GDIBitmapObject; Img := PGDIObject(ACursorInfo^.hbmColor)^.GDIBitmapObject;
if (PGDIObject(ACursorInfo^.hbmColor)^.GDIBitmapType = gbPixmap) and if (PGDIObject(ACursorInfo^.hbmColor)^.GDIBitmapType = gbPixmap) and
(PGDIObject(ACursorInfo^.hbmColor)^.GDIPixmapObject.Mask <> nil) then (PGDIObject(ACursorInfo^.hbmColor)^.GDIPixmapObject.Mask <> nil) then
@ -3330,7 +3330,7 @@ begin
end; end;
{.$define VerboseEnumFonts} {.$define VerboseEnumFonts}
{$note: compare TGtkWidgetSet.EnumFontFamilies with gtkproc.FillScreenFonts} {$IFDEF VerboseGtkToDos}{$note: compare TGtkWidgetSet.EnumFontFamilies with gtkproc.FillScreenFonts}{$ENDIF}
function TGtkWidgetSet.EnumFontFamilies(DC: HDC; Family: Pchar; function TGtkWidgetSet.EnumFontFamilies(DC: HDC; Family: Pchar;
EnumFontFamProc: FontEnumProc; LParam:Lparam):longint; EnumFontFamProc: FontEnumProc; LParam:Lparam):longint;
var var
@ -3363,7 +3363,7 @@ begin
{$ifdef HasX} {$ifdef HasX}
XFonts := XListFonts(gdk_display, pchar(Tmp), 10000, @N); XFonts := XListFonts(gdk_display, pchar(Tmp), 10000, @N);
{$else} {$else}
{$warning implement getting XFonts for this OS} {$IFDEF VerboseGtkToDos}{$warning implement getting XFonts for this OS}{$ENDIF}
N:=0; N:=0;
{$endif} {$endif}
try try
@ -3748,7 +3748,7 @@ begin
{$ifdef HasX} {$ifdef HasX}
XFonts := XListFonts(gdk_display, pchar(Tmp), 10000, @N); XFonts := XListFonts(gdk_display, pchar(Tmp), 10000, @N);
{$else} {$else}
{$warning implement getting XFonts for this OS} {$IFDEF VerboseGtkToDos}{$warning implement getting XFonts for this OS}{$ENDIF}
N:=0; N:=0;
{$endif} {$endif}
try try

View File

@ -496,10 +496,11 @@ end;
class procedure TGtkWSCustomListView.ItemChangeInternal(const ACListWidget: PGtkCList; const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem); class procedure TGtkWSCustomListView.ItemChangeInternal(const ACListWidget: PGtkCList; const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem);
var var
ImageBitmap, MaskBitmap: TBitmap; //ImageBitmap: TBitmap;
ImageRect: TRect; //MaskBitmap: TBitmap;
Pixmap: PGdkPixmap; //ImageRect: TRect;
Mask: PGdkBitmap; //Pixmap: PGdkPixmap;
//Mask: PGdkBitmap;
n, Count: integer; n, Count: integer;
begin begin
if (TLVHack(ALV).SmallImages <> nil) if (TLVHack(ALV).SmallImages <> nil)
@ -524,7 +525,7 @@ begin
if Mask <> nil if Mask <> nil
then gdk_bitmap_unref(Mask); then gdk_bitmap_unref(Mask);
{$else} {$else}
{$note implement} {$IFDEF VerboseGtkToDos}{$note implement}{$ENDIF}
{$endif} {$endif}
end end
else begin else begin
@ -637,8 +638,9 @@ class procedure TGtkWSCustomListView.ItemSetImage(const ALV: TCustomListView; co
var var
WidgetInfo: PWidgetInfo; WidgetInfo: PWidgetInfo;
CListWidget: PGtkCList; CListWidget: PGtkCList;
ImageBitmap, MaskBitmap: TBitmap; //ImageBitmap: TBitmap;
ImageRect: TRect; //MaskBitmap: TBitmap;
//ImageRect: TRect;
Pixmap: PGdkPixmap; Pixmap: PGdkPixmap;
Mask: PGdkBitmap; Mask: PGdkBitmap;
Spacing: guint8; Spacing: guint8;
@ -676,7 +678,7 @@ begin
Mask := nil; Mask := nil;
end; end;
{$else} {$else}
{$note implement} {$IFDEF VerboseGtkToDos}{$note implement}{$ENDIF}
Pixmap := nil; Pixmap := nil;
Mask := nil; Mask := nil;
{$endif} {$endif}

View File

@ -196,7 +196,7 @@ end;
class procedure TGtkWSScrollingWinControl.ScrollBy(const AWinControl: TScrollingWinControl; class procedure TGtkWSScrollingWinControl.ScrollBy(const AWinControl: TScrollingWinControl;
const DeltaX, DeltaY: integer); const DeltaX, DeltaY: integer);
begin begin
{$note implement me} {$IFDEF VerboseGtkToDos}{$note implement me}{$ENDIF}
end; end;
class procedure TGtkWSScrollingWinControl.SetColor( class procedure TGtkWSScrollingWinControl.SetColor(

View File

@ -615,7 +615,7 @@ class function TGtkWSCustomListBox.GetSelected(const ACustomListBox: TCustomList
var var
Handle: HWND; Handle: HWND;
Widget : PGtkWidget; // pointer to gtk-widget (local use when neccessary) Widget : PGtkWidget; // pointer to gtk-widget (local use when neccessary)
GList : pGList; // Only used for listboxes, replace with widget!!!!! //GList : pGList; // Only used for listboxes, replace with widget!!!!!
ListItem : PGtkListItem;// currently only used for listboxes ListItem : PGtkListItem;// currently only used for listboxes
begin begin
Result := false; { assume: nothing found } Result := false; { assume: nothing found }

View File

@ -892,7 +892,7 @@ begin
TLVHack(ALV).SmallImages.GetBitmap(AItem.ImageIndex, BitImage); TLVHack(ALV).SmallImages.GetBitmap(AItem.ImageIndex, BitImage);
case PGDIObject(BitImage.handle)^.GDIBitmapType of case PGDIObject(BitImage.handle)^.GDIBitmapType of
gbBitmap: Drawable := PGDIObject(BitImage.handle)^.GDIBitmapObject; gbBitmap: Drawable := PGDIObject(BitImage.handle)^.GDIBitmapObject;
gbPixmap: Drawable := PGDIObject(BitImage.handle)^.GDIPixmapObject.Image; {$note TODO add alpha mask} gbPixmap: Drawable := PGDIObject(BitImage.handle)^.GDIPixmapObject.Image; {$IFDEF VerboseGtkToDos}{$note TODO add alpha mask}{$ENDIF}
else else
Drawable := nil; Drawable := nil;
end; end;

View File

@ -4852,7 +4852,7 @@ begin
// force alpha description // force alpha description
CheckAlphaDescription(TheImage); CheckAlphaDescription(TheImage);
{$note check if height is also doubled without mask} {$IFDEF VerboseLCLTodos}{$note check if height is also doubled without mask}{$ENDIF}
FBFI.biHeight := FBFI.biHeight div 2; { Height field is doubled, to (sort of) accomodate mask } FBFI.biHeight := FBFI.biHeight div 2; { Height field is doubled, to (sort of) accomodate mask }
InternalReadBody; { Now read standard bitmap } InternalReadBody; { Now read standard bitmap }

View File

@ -1943,7 +1943,7 @@ end;
procedure TPostScriptPrinterCanvas.TextRect(ARect: TRect; X, Y: integer; procedure TPostScriptPrinterCanvas.TextRect(ARect: TRect; X, Y: integer;
const Text: string; const Style: TTextStyle); const Text: string; const Style: TTextStyle);
begin begin
{$WARNING TPostScriptPrinterCanvas.TextRect is not yet fully implemented!} {$IFDEF VerboseLCLTodos}{$WARNING TPostScriptPrinterCanvas.TextRect is not yet fully implemented!}{$ENDIF}
//TODO: clipping, layout, etc. //TODO: clipping, layout, etc.
TextOut(X,Y, Text); TextOut(X,Y, Text);
end; end;