mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 04:35:57 +02:00
attaching menuitems topdown
git-svn-id: trunk@4348 -
This commit is contained in:
parent
5f79f11b3d
commit
d86c28d794
@ -32,12 +32,12 @@ interface
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
GraphType, SysUtils, Classes, LCLStrConsts, vclGlobals, LMessages, LCLType,
|
SysUtils, Classes,
|
||||||
LCLProc, LCLLinux, LResources,
|
|
||||||
{$IFDEF UseFPImage}
|
{$IFDEF UseFPImage}
|
||||||
FPImage,
|
FPImage,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
GraphMath;
|
LCLStrConsts, vclGlobals, LMessages, LCLType, LCLProc, LCLLinux, LResources,
|
||||||
|
GraphType, GraphMath;
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -1031,6 +1031,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.75 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.74 2003/06/30 17:25:26 mattias
|
Revision 1.74 2003/06/30 17:25:26 mattias
|
||||||
fixed parsing of with do try finally end
|
fixed parsing of with do try finally end
|
||||||
|
|
||||||
|
@ -173,6 +173,63 @@ type
|
|||||||
tmFixed
|
tmFixed
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// raw image data
|
||||||
|
type
|
||||||
|
TRawImageColorFormat = (
|
||||||
|
ricfRGBA, // one pixel contains red, green, blue and alpha
|
||||||
|
// If AlphaPrec=0 then there is no alpha.
|
||||||
|
// Same for RedPrec, GreenPrec and BluePrec.
|
||||||
|
ricfRGB, // like ricfRGBA, but alpha is stored separate in a mask.
|
||||||
|
// If AlphaPrec=0 then there is no alpha.
|
||||||
|
ricfGray, // R=G=B. The Red stores the Gray.
|
||||||
|
ricfPalette // The Red is color index and ColorCount is set
|
||||||
|
);
|
||||||
|
|
||||||
|
TRawImageByteOrder = (
|
||||||
|
riboLSBFirst, // least significant byte first
|
||||||
|
riboMSBFirst // most significant byte first
|
||||||
|
);
|
||||||
|
|
||||||
|
TRawImageLineEnd = (
|
||||||
|
rileTight, // no gap at end of lines
|
||||||
|
rileByteBoundary, // each line starts at byte boundary. For example:
|
||||||
|
// If BitsPerPixel=3 and Width=1, each line has a gap
|
||||||
|
// of 5 unused bits at the end.
|
||||||
|
rileWordBoundary, // each line starts at word (16bit) boundary
|
||||||
|
rileDWordBoundary, // each line starts at double word (32bit) boundary
|
||||||
|
rileQWordBoundary // each line starts at quad word (64bit) boundary
|
||||||
|
);
|
||||||
|
|
||||||
|
TRawImageLineOrder = (
|
||||||
|
rivoTopToBottom, // The line 0 is the top line
|
||||||
|
rivoBottomToTop // The line 0 is the bottom line
|
||||||
|
);
|
||||||
|
|
||||||
|
TRawImageDescription = record
|
||||||
|
Format: TRawImageColorFormat;
|
||||||
|
Depth: cardinal; // used bits per pixel (= RedPrec + GreenPrec + BluePrec)
|
||||||
|
Width: cardinal;
|
||||||
|
Height: cardinal;
|
||||||
|
ByteOrder: TRawImageByteOrder;
|
||||||
|
LineOrder: TRawImageLineOrder;
|
||||||
|
ColorCount: cardinal; // entries in color palette. Ignore when no palette.
|
||||||
|
BitsPerPixel: cardinal; // bits per pixel. can be greater than Depth.
|
||||||
|
LineEnd: TRawImageLineEnd;
|
||||||
|
RedPrec: cardinal; // red precision. bits for red
|
||||||
|
RedShift: cardinal;
|
||||||
|
GreenPrec: cardinal;
|
||||||
|
GreenShift: cardinal;
|
||||||
|
BluePrec: cardinal;
|
||||||
|
BlueShift: cardinal;
|
||||||
|
AlphaPrec: cardinal;
|
||||||
|
AlphaShift: cardinal;
|
||||||
|
// The next values are only valid if there is a separate alpha mask
|
||||||
|
AlphaBitsPerPixel: cardinal; // bits per alpha mask pixel.
|
||||||
|
AlphaLineEnd: TRawImageLineEnd;
|
||||||
|
end;
|
||||||
|
PRawImageDescription = ^TRawImageDescription;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
end.
|
end.
|
||||||
@ -180,6 +237,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.12 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.11 2003/06/30 14:58:29 mattias
|
Revision 1.11 2003/06/30 14:58:29 mattias
|
||||||
implemented multi file add to package editor
|
implemented multi file add to package editor
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ end;
|
|||||||
|
|
||||||
function TBitmap.HandleAllocated: boolean;
|
function TBitmap.HandleAllocated: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=FImage.FHandle<>0;
|
Result:=(FImage<>nil) and (FImage.FHandle<>0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBitMap.Mask(ATransparentColor: TColor);
|
procedure TBitMap.Mask(ATransparentColor: TColor);
|
||||||
@ -357,16 +357,16 @@ var
|
|||||||
if ReadSize<>InfoSize then
|
if ReadSize<>InfoSize then
|
||||||
raise EInOutError.Create(
|
raise EInOutError.Create(
|
||||||
'TBitmap.ReadBMPStream: Invalid windows bitmap (info)');
|
'TBitmap.ReadBMPStream: Invalid windows bitmap (info)');
|
||||||
if BmpInfo^.bmiHeader.biSize<>sizeof(BitmapInfoHeader) then
|
if BmpInfo^.bmiHeader.biSize<>SizeOf(BitmapInfoHeader) then
|
||||||
raise EInOutError.Create(
|
raise EInOutError.Create(
|
||||||
'TBitmap.ReadBMPStream: OS2 bitmaps are not supported yet');
|
'TBitmap.ReadBMPStream: OS2 bitmaps are not supported yet');
|
||||||
if BmpInfo^.bmiHeader.biCompression<>bi_RGB then
|
if BmpInfo^.bmiHeader.biCompression<>bi_RGB then
|
||||||
raise EInOutError.Create(
|
raise EInOutError.Create(
|
||||||
'TBitmap.ReadBMPStream: RLE compression is not supported yet');
|
'TBitmap.ReadBMPStream: RLE compression is not supported yet');
|
||||||
|
|
||||||
// Let's now support only 24bit bmps! Then we can use the palette.
|
// Let's now support only 16/24bit bmps! Then we don't need a palette.
|
||||||
BitsPerPixel:=BmpInfo^.bmiHeader.biBitCount;
|
BitsPerPixel:=BmpInfo^.bmiHeader.biBitCount;
|
||||||
if BitsPerPixel<>24 then begin
|
if BitsPerPixel<16 then begin
|
||||||
ColorsUsed:=BmpInfo^.bmiHeader.biClrUsed;
|
ColorsUsed:=BmpInfo^.bmiHeader.biClrUsed;
|
||||||
if ColorsUsed=0 then ColorsUsed:=1 shl ColorsUsed;
|
if ColorsUsed=0 then ColorsUsed:=1 shl ColorsUsed;
|
||||||
// s:=SizeOf(TLogPalette)+(ColorsUsed-1)*SizeOf(TPaletteEntry);
|
// s:=SizeOf(TLogPalette)+(ColorsUsed-1)*SizeOf(TPaletteEntry);
|
||||||
@ -716,6 +716,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.37 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.36 2003/06/30 17:25:26 mattias
|
Revision 1.36 2003/06/30 17:25:26 mattias
|
||||||
fixed parsing of with do try finally end
|
fixed parsing of with do try finally end
|
||||||
|
|
||||||
|
@ -66,7 +66,6 @@ begin
|
|||||||
IsEmpty:=Empty;
|
IsEmpty:=Empty;
|
||||||
Result:=(IsEmpty=Graphic.Empty);
|
Result:=(IsEmpty=Graphic.Empty);
|
||||||
if (not Result) or IsEmpty or (Self=Graphic) then exit;
|
if (not Result) or IsEmpty or (Self=Graphic) then exit;
|
||||||
// ToDo: check for same resource
|
|
||||||
SelfImage := TMemoryStream.Create;
|
SelfImage := TMemoryStream.Create;
|
||||||
try
|
try
|
||||||
WriteData(SelfImage);
|
WriteData(SelfImage);
|
||||||
|
@ -866,6 +866,12 @@ begin
|
|||||||
Result := 0;
|
Result := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TInterfaceBase.GetDeviceRawImageDescription(DC: HDC;
|
||||||
|
Desc: PRawImageDescription): boolean;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
end;
|
||||||
|
|
||||||
function TInterfaceBase.GetDeviceSize(DC: HDC; var p: TPoint): boolean;
|
function TInterfaceBase.GetDeviceSize(DC: HDC; var p: TPoint): boolean;
|
||||||
begin
|
begin
|
||||||
p.X := 0;
|
p.X := 0;
|
||||||
@ -1733,6 +1739,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.91 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.90 2002/08/19 15:15:23 mattias
|
Revision 1.90 2002/08/19 15:15:23 mattias
|
||||||
implemented TPairSplitter
|
implemented TPairSplitter
|
||||||
|
|
||||||
|
@ -105,16 +105,19 @@ var i: Integer;
|
|||||||
begin
|
begin
|
||||||
//writeln('TMenuItem.CreateHandle START ',Name,':',ClassName);
|
//writeln('TMenuItem.CreateHandle START ',Name,':',ClassName);
|
||||||
SendMsgToInterface(LM_CREATE, Self, nil);
|
SendMsgToInterface(LM_CREATE, Self, nil);
|
||||||
if FItems<>nil then begin
|
|
||||||
for i := 0 to Count - 1 do begin
|
|
||||||
Items[i].HandleNeeded;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
if Parent <> nil then
|
if Parent <> nil then
|
||||||
begin
|
begin
|
||||||
Parent.HandleNeeded;
|
Parent.HandleNeeded;
|
||||||
if Parent.HandleAllocated then
|
if Parent.HandleAllocated then
|
||||||
SendMsgToInterface(LM_ATTACHMENU, Self, nil);
|
SendMsgToInterface(LM_ATTACHMENU, Self, nil);
|
||||||
|
end;
|
||||||
|
if FItems<>nil then begin
|
||||||
|
for i := 0 to Count - 1 do begin
|
||||||
|
Items[i].HandleNeeded;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if (Parent<>nil) then
|
||||||
|
begin
|
||||||
if HandleAllocated then begin
|
if HandleAllocated then begin
|
||||||
if ShortCut <> 0 then ShortCutChanged(0, Shortcut);
|
if ShortCut <> 0 then ShortCutChanged(0, Shortcut);
|
||||||
end;
|
end;
|
||||||
@ -955,6 +958,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.37 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.36 2003/06/26 17:00:00 mattias
|
Revision 1.36 2003/06/26 17:00:00 mattias
|
||||||
fixed result on searching proc in interface
|
fixed result on searching proc in interface
|
||||||
|
|
||||||
@ -1091,6 +1097,9 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.37 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.36 2003/06/26 17:00:00 mattias
|
Revision 1.36 2003/06/26 17:00:00 mattias
|
||||||
fixed result on searching proc in interface
|
fixed result on searching proc in interface
|
||||||
|
|
||||||
|
@ -395,9 +395,11 @@ begin
|
|||||||
Result := InterfaceObject.GetDC(hWnd);
|
Result := InterfaceObject.GetDC(hWnd);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: UINT; Bits: Pointer; var BitInfo: BitmapInfo; Usage: UINT): Integer;
|
function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: UINT;
|
||||||
|
Bits: Pointer; var BitInfo: BitmapInfo; Usage: UINT): Integer;
|
||||||
begin
|
begin
|
||||||
Result := InterfaceObject.GetDIBits(DC, Bitmap, StartScan, NumScans, Bits, BitInfo, Usage);
|
Result := InterfaceObject.GetDIBits(DC, Bitmap, StartScan, NumScans, Bits,
|
||||||
|
BitInfo, Usage);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetDeviceCaps(DC: HDC; Index: Integer): Integer;
|
function GetDeviceCaps(DC: HDC; Index: Integer): Integer;
|
||||||
@ -405,6 +407,12 @@ begin
|
|||||||
Result := InterfaceObject.GetDeviceCaps(DC, Index);
|
Result := InterfaceObject.GetDeviceCaps(DC, Index);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetDeviceRawImageDescription(DC: HDC;
|
||||||
|
Desc: PRawImageDescription): boolean;
|
||||||
|
begin
|
||||||
|
Result := InterfaceObject.GetDeviceRawImageDescription(DC,Desc);
|
||||||
|
end;
|
||||||
|
|
||||||
function GetDeviceSize(DC: HDC; var p: TPoint): boolean;
|
function GetDeviceSize(DC: HDC; var p: TPoint): boolean;
|
||||||
begin
|
begin
|
||||||
Result := InterfaceObject.GetDeviceSize(DC,p);
|
Result := InterfaceObject.GetDeviceSize(DC,p);
|
||||||
@ -1615,6 +1623,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.84 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.83 2002/08/19 15:15:23 mattias
|
Revision 1.83 2002/08/19 15:15:23 mattias
|
||||||
implemented TPairSplitter
|
implemented TPairSplitter
|
||||||
|
|
||||||
|
@ -121,6 +121,7 @@ function GetCursorPos(var lpPoint: TPoint): Boolean; {$IFDEF IF_BASE_MEMBER}virt
|
|||||||
function GetCharABCWidths(DC: HDC; p2, p3: UINT; const ABCStructs): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} //pbd
|
function GetCharABCWidths(DC: HDC; p2, p3: UINT; const ABCStructs): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} //pbd
|
||||||
function GetDC(hWnd: HWND): HDC; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetDC(hWnd: HWND): HDC; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetDeviceCaps(DC: HDC; Index: Integer): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetDeviceCaps(DC: HDC; Index: Integer): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
function GetDeviceRawImageDescription(DC: HDC; Desc: PRawImageDescription): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetDeviceSize(DC: HDC; var p: TPoint): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetDeviceSize(DC: HDC; var p: TPoint): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: UINT; Bits: Pointer; var BitInfo: BitmapInfo; Usage: UINT): Integer;{$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: UINT; Bits: Pointer; var BitInfo: BitmapInfo; Usage: UINT): Integer;{$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function GetFocus: HWND; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function GetFocus: HWND; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
@ -383,6 +384,9 @@ procedure RaiseLastOSError;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.77 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.76 2002/08/19 15:15:24 mattias
|
Revision 1.76 2002/08/19 15:15:24 mattias
|
||||||
implemented TPairSplitter
|
implemented TPairSplitter
|
||||||
|
|
||||||
|
@ -3825,6 +3825,21 @@ end;
|
|||||||
|
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TgtkObject.GetDeviceCaps(DC: HDC; Index: Integer): Integer;
|
function TgtkObject.GetDeviceCaps(DC: HDC; Index: Integer): Integer;
|
||||||
|
var
|
||||||
|
Visual: PGdkVisual;
|
||||||
|
|
||||||
|
function GetVisual: boolean;
|
||||||
|
begin
|
||||||
|
Visual:=nil;
|
||||||
|
with TDeviceContext(DC) do begin
|
||||||
|
If Drawable <> nil then
|
||||||
|
Visual:=gdk_window_get_visual(PGdkWindow(Drawable));
|
||||||
|
if Visual = nil then
|
||||||
|
Visual := GDK_Visual_Get_System;
|
||||||
|
end;
|
||||||
|
Result:=Visual<>nil;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := -1;
|
Result := -1;
|
||||||
If DC = 0 then begin
|
If DC = 0 then begin
|
||||||
@ -3834,11 +3849,9 @@ begin
|
|||||||
Result := GetDeviceCaps(DC, Index);
|
Result := GetDeviceCaps(DC, Index);
|
||||||
ReleaseDC(0, DC);
|
ReleaseDC(0, DC);
|
||||||
end;
|
end;
|
||||||
if IsValidDC(DC)
|
if not IsValidDC(DC) then exit;
|
||||||
then with TDeviceContext(DC) do
|
with TDeviceContext(DC) do
|
||||||
begin
|
|
||||||
Case Index of
|
Case Index of
|
||||||
//The important ones I know how to do
|
|
||||||
HORZRES : { Horizontal width in pixels }
|
HORZRES : { Horizontal width in pixels }
|
||||||
If Drawable = nil then
|
If Drawable = nil then
|
||||||
Result := GetSystemMetrics(SM_CXSCREEN)
|
Result := GetSystemMetrics(SM_CXSCREEN)
|
||||||
@ -3851,12 +3864,16 @@ begin
|
|||||||
else
|
else
|
||||||
gdk_window_get_geometry(Drawable, nil, nil, nil, @Result, nil);
|
gdk_window_get_geometry(Drawable, nil, nil, nil, @Result, nil);
|
||||||
|
|
||||||
BITSPIXEL : { Number of bits per pixel }
|
BITSPIXEL : { Number of used bits per pixel = depth }
|
||||||
If Drawable = nil then
|
If Drawable = nil then
|
||||||
Result := GDK_Visual_Get_System^.Depth
|
Result := GDK_Visual_Get_System^.Depth
|
||||||
else
|
else
|
||||||
gdk_window_get_geometry(Drawable, nil, nil, nil, nil, @Result);
|
gdk_window_get_geometry(Drawable, nil, nil, nil, nil, @Result);
|
||||||
|
|
||||||
|
PLANES : { Number of planes }
|
||||||
|
// ToDo
|
||||||
|
Result := 1;
|
||||||
|
|
||||||
//For Size in MM, MM = (Pixels*100)/(PPI*25.4)
|
//For Size in MM, MM = (Pixels*100)/(PPI*25.4)
|
||||||
|
|
||||||
HORZSIZE : { Horizontal size in millimeters }
|
HORZSIZE : { Horizontal size in millimeters }
|
||||||
@ -3876,8 +3893,95 @@ begin
|
|||||||
|
|
||||||
LOGPIXELSY : { Logical pixels per inch in Y }
|
LOGPIXELSY : { Logical pixels per inch in Y }
|
||||||
Result := Round(gdk_screen_height / (gdk_screen_height_mm / 25.4));
|
Result := Round(gdk_screen_height / (gdk_screen_height_mm / 25.4));
|
||||||
|
|
||||||
|
SIZEPALETTE: { number of entries in color palette }
|
||||||
|
if GetVisual then
|
||||||
|
Result:=Visual^.colormap_size
|
||||||
|
else
|
||||||
|
Result:=0;
|
||||||
|
|
||||||
|
NUMRESERVED: { number of reserverd colors in color palette }
|
||||||
|
Result:=0;
|
||||||
|
|
||||||
|
else
|
||||||
|
writeln('TgtkObject.GetDeviceCaps not supported: Type=',Index);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
function GetDeviceRawImageDescription(DC: HDC;
|
||||||
|
Desc: PRawImageDescription): boolean;
|
||||||
|
|
||||||
|
Retrieves the information about the structure of the supported image data.
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
function TgtkObject.GetDeviceRawImageDescription(DC: HDC;
|
||||||
|
Desc: PRawImageDescription): boolean;
|
||||||
|
var
|
||||||
|
Visual: PGdkVisual;
|
||||||
|
Width, Height: integer;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
Visual:=nil;
|
||||||
|
If IsValidDC(DC) then
|
||||||
|
with TDeviceContext(DC) do begin
|
||||||
|
If Drawable <> nil then
|
||||||
|
Visual:=gdk_window_get_visual(PGdkWindow(Drawable));
|
||||||
|
GDK_Window_Get_Size(PGdkWindow(Drawable),@Width,@Height);
|
||||||
|
end;
|
||||||
|
if Visual = nil then begin
|
||||||
|
Visual := GDK_Visual_Get_System;
|
||||||
|
if Visual=nil then exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
FillChar(Desc,SizeOf(TRawImageDescription),0);
|
||||||
|
|
||||||
|
// Format
|
||||||
|
case Visual^.thetype of
|
||||||
|
|
||||||
|
GDK_VISUAL_STATIC_GRAY: Desc^.Format:=ricfGray;
|
||||||
|
GDK_VISUAL_GRAYSCALE: Desc^.Format:=ricfPalette;
|
||||||
|
GDK_VISUAL_STATIC_COLOR: Desc^.Format:=ricfPalette;
|
||||||
|
GDK_VISUAL_PSEUDO_COLOR: Desc^.Format:=ricfPalette;
|
||||||
|
GDK_VISUAL_TRUE_COLOR: Desc^.Format:=ricfRGB;
|
||||||
|
GDK_VISUAL_DIRECT_COLOR: Desc^.Format:=ricfRGB;
|
||||||
|
else
|
||||||
|
writeln('TgtkObject.GetDeviceRawImageDescription unknown Visual type ',Visual^.thetype);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Depth
|
||||||
|
Desc^.Depth:=Visual^.Depth;
|
||||||
|
// Width + Height
|
||||||
|
Desc^.Width:=cardinal(Width);
|
||||||
|
Desc^.Height:=cardinal(Height);
|
||||||
|
// ByteOrder
|
||||||
|
if Visual^.byte_order=GDK_MSB_FIRST then
|
||||||
|
Desc^.ByteOrder:=riboMSBFirst
|
||||||
|
else
|
||||||
|
Desc^.ByteOrder:=riboLSBFirst;
|
||||||
|
// LineOrder
|
||||||
|
Desc^.LineOrder:=rivoTopToBottom;
|
||||||
|
// ColorCount
|
||||||
|
Desc^.ColorCount:=0;
|
||||||
|
// BitsPerPixel
|
||||||
|
Desc^.BitsPerPixel:=Visual^.bits_per_rgb;
|
||||||
|
// LineEnd
|
||||||
|
Desc^.LineEnd:=rileByteBoundary;
|
||||||
|
// Precisions and Shifts
|
||||||
|
Desc^.RedPrec:=Visual^.red_prec;
|
||||||
|
Desc^.RedShift:=Visual^.red_shift;
|
||||||
|
Desc^.GreenPrec:=Visual^.green_prec;
|
||||||
|
Desc^.GreenShift:=Visual^.green_shift;
|
||||||
|
Desc^.BluePrec:=Visual^.blue_prec;
|
||||||
|
Desc^.BlueShift:=Visual^.blue_shift;
|
||||||
|
Desc^.AlphaPrec:=1;
|
||||||
|
Desc^.AlphaShift:=0;
|
||||||
|
// AlphaBitsPerPixel and AlphaLineEnd
|
||||||
|
Desc^.AlphaBitsPerPixel:=Desc^.AlphaPrec;
|
||||||
|
Desc^.AlphaLineEnd:=rileByteBoundary;
|
||||||
|
|
||||||
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -4124,7 +4228,7 @@ begin
|
|||||||
end else
|
end else
|
||||||
biBitCount := Visual^.Depth;
|
biBitCount := Visual^.Depth;
|
||||||
|
|
||||||
If biBitCount < 24 then
|
If biBitCount < 16 then
|
||||||
NumColors := Colormap^.Size;
|
NumColors := Colormap^.Size;
|
||||||
|
|
||||||
biSizeImage := (((biBitCount*biWidth+31) shr 5) shl 2)*biHeight;
|
biSizeImage := (((biBitCount*biWidth+31) shr 5) shl 2)*biHeight;
|
||||||
@ -4148,7 +4252,7 @@ begin
|
|||||||
bmBitsPixel := biBitCount;
|
bmBitsPixel := biBitCount;
|
||||||
|
|
||||||
//Need to retrieve actual Number of Colors if Indexed Image
|
//Need to retrieve actual Number of Colors if Indexed Image
|
||||||
if (bmBitsPixel < 24) then begin
|
if (bmBitsPixel < 16) then begin
|
||||||
biClrUsed := NumColors;
|
biClrUsed := NumColors;
|
||||||
biClrImportant := biClrUsed;
|
biClrImportant := biClrUsed;
|
||||||
end;
|
end;
|
||||||
@ -4164,6 +4268,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
gdiBrush:
|
gdiBrush:
|
||||||
begin
|
begin
|
||||||
Assert(False, 'Trace:TODO: [TgtkObject.GetObject] gdiBrush');
|
Assert(False, 'Trace:TODO: [TgtkObject.GetObject] gdiBrush');
|
||||||
@ -8484,6 +8589,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.253 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.252 2003/06/30 10:09:46 mattias
|
Revision 1.252 2003/06/30 10:09:46 mattias
|
||||||
fixed Get/SetPixel for DC without widget
|
fixed Get/SetPixel for DC without widget
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ Function GetClipRGN(DC : hDC; RGN : hRGN) : Longint; override;
|
|||||||
Function GetCmdLineParamDescForInterface: string; override;
|
Function GetCmdLineParamDescForInterface: string; override;
|
||||||
function GetDC(hWnd: HWND): HDC; override;
|
function GetDC(hWnd: HWND): HDC; override;
|
||||||
function GetDeviceCaps(DC: HDC; Index: Integer): Integer; Override;
|
function GetDeviceCaps(DC: HDC; Index: Integer): Integer; Override;
|
||||||
|
function GetDeviceRawImageDescription(DC: HDC; Desc: PRawImageDescription): boolean; override;
|
||||||
function GetDeviceSize(DC: HDC; var p: TPoint): boolean; override;
|
function GetDeviceSize(DC: HDC; var p: TPoint): boolean; override;
|
||||||
function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: UINT; Bits: Pointer; var BitInfo: BitmapInfo; Usage: UINT): Integer; Override;
|
function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: UINT; Bits: Pointer; var BitInfo: BitmapInfo; Usage: UINT): Integer; Override;
|
||||||
function GetFocus: HWND; override;
|
function GetFocus: HWND; override;
|
||||||
@ -205,6 +206,9 @@ Procedure DeleteCriticalSection(var CritSection: TCriticalSection); Override;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.70 2003/07/01 09:29:52 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.69 2002/08/19 15:15:24 mattias
|
Revision 1.69 2002/08/19 15:15:24 mattias
|
||||||
implemented TPairSplitter
|
implemented TPairSplitter
|
||||||
|
|
||||||
|
@ -1324,14 +1324,16 @@ const
|
|||||||
BI_BITFIELDS = 3;
|
BI_BITFIELDS = 3;
|
||||||
|
|
||||||
|
|
||||||
HORZSIZE = 4;
|
HORZSIZE = 4; { Horizontal size in millimeters }
|
||||||
VERTSIZE = 6;
|
VERTSIZE = 6; { Vertical size in millimeters }
|
||||||
HORZRES = 8;
|
HORZRES = 8; { Horizontal width in pixels }
|
||||||
VERTRES = 10;
|
VERTRES = 10; { Vertical height in pixels }
|
||||||
BITSPIXEL = 12;
|
BITSPIXEL = 12; { Number of bits per pixel }
|
||||||
PLANES = 14;
|
PLANES = 14; { Number of planes }
|
||||||
LOGPIXELSX = 88;
|
LOGPIXELSX = 88; { Logical pixelsinch in X }
|
||||||
LOGPIXELSY = 90;
|
LOGPIXELSY = 90; { Logical pixelsinch in Y }
|
||||||
|
SIZEPALETTE = 104; { Number of entries in physical palette }
|
||||||
|
NUMRESERVED = 106; { Number of reserved entries in palette }
|
||||||
|
|
||||||
|
|
||||||
{ Text Alignment Options }
|
{ Text Alignment Options }
|
||||||
@ -1343,7 +1345,7 @@ const
|
|||||||
TA_CENTER = 6;
|
TA_CENTER = 6;
|
||||||
TA_TOP = 0;
|
TA_TOP = 0;
|
||||||
TA_BOTTOM = 8;
|
TA_BOTTOM = 8;
|
||||||
TA_BASELINE = 24;
|
TA_BASELINE = $18;
|
||||||
TA_RTLREADING = $100;
|
TA_RTLREADING = $100;
|
||||||
TA_MASK = (TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING);
|
TA_MASK = (TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING);
|
||||||
|
|
||||||
@ -1669,7 +1671,6 @@ type
|
|||||||
type
|
type
|
||||||
TFNTimerProc = procedure of object;
|
TFNTimerProc = procedure of object;
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// clipboard
|
// clipboard
|
||||||
type
|
type
|
||||||
@ -1811,6 +1812,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.38 2003/07/01 09:29:51 mattias
|
||||||
|
attaching menuitems topdown
|
||||||
|
|
||||||
Revision 1.37 2003/05/19 08:16:33 mattias
|
Revision 1.37 2003/05/19 08:16:33 mattias
|
||||||
fixed allocation of dc backcolor
|
fixed allocation of dc backcolor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user