diff options
-rw-r--r-- | examples/gui/gridtest/gridtest.lpi | 107 | ||||
-rw-r--r-- | examples/gui/listviewtest/listviewtest.lpi | 104 | ||||
-rw-r--r-- | src/corelib/fpgfx.pas | 3 | ||||
-rw-r--r-- | src/corelib/gfx_extinterpolation.pas | 53 | ||||
-rw-r--r-- | src/corelib/gfxbase.pas | 3 | ||||
-rw-r--r-- | src/corelib/x11/gfx_x11.pas | 46 |
6 files changed, 141 insertions, 175 deletions
diff --git a/examples/gui/gridtest/gridtest.lpi b/examples/gui/gridtest/gridtest.lpi index ff9c418c..9b698ffe 100644 --- a/examples/gui/gridtest/gridtest.lpi +++ b/examples/gui/gridtest/gridtest.lpi @@ -1,54 +1,53 @@ -<?xml version="1.0"?>
-<CONFIG>
- <ProjectOptions>
- <PathDelim Value="\"/>
- <Version Value="5"/>
- <General>
- <Flags>
- <SaveOnlyProjectUnits Value="True"/>
- </Flags>
- <SessionStorage Value="InProjectDir"/>
- <MainUnit Value="0"/>
- <IconPath Value=".\"/>
- <TargetFileExt Value=""/>
- </General>
- <VersionInfo>
- <ProjectVersion Value=""/>
- </VersionInfo>
- <PublishOptions>
- <Version Value="2"/>
- <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
- <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
- </PublishOptions>
- <RunParams>
- <local>
- <FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
- </local>
- </RunParams>
- <RequiredPackages Count="1">
- <Item1>
- <PackageName Value="fpgui_package"/>
- <MinVersion Minor="5" Valid="True"/>
- </Item1>
- </RequiredPackages>
- <Units Count="1">
- <Unit0>
- <Filename Value="gridtest.lpr"/>
- <IsPartOfProject Value="True"/>
- <UnitName Value="gridtest"/>
- </Unit0>
- </Units>
- </ProjectOptions>
- <CompilerOptions>
- <Version Value="5"/>
- <PathDelim Value="\"/>
- <CodeGeneration>
- <Generate Value="Faster"/>
- </CodeGeneration>
- <Other>
- <CustomOptions Value="-FUunits"/>
- <CompilerPath Value="$(CompPath)"/>
- </Other>
- </CompilerOptions>
-</CONFIG>
+<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <PathDelim Value="/"/> + <Version Value="5"/> + <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <IconPath Value="./"/> + <TargetFileExt Value=""/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="fpgui_package"/> + <MinVersion Minor="5" Valid="True"/> + </Item1> + </RequiredPackages> + <Units Count="1"> + <Unit0> + <Filename Value="gridtest.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="gridtest"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="5"/> + <CodeGeneration> + <Generate Value="Faster"/> + </CodeGeneration> + <Other> + <CustomOptions Value="-FUunits"/> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/examples/gui/listviewtest/listviewtest.lpi b/examples/gui/listviewtest/listviewtest.lpi index c096e8a8..8e8f6e62 100644 --- a/examples/gui/listviewtest/listviewtest.lpi +++ b/examples/gui/listviewtest/listviewtest.lpi @@ -1,53 +1,51 @@ -<?xml version="1.0"?>
-<CONFIG>
- <ProjectOptions>
- <PathDelim Value="\"/>
- <Version Value="5"/>
- <General>
- <SessionStorage Value="InProjectDir"/>
- <MainUnit Value="0"/>
- <IconPath Value=".\"/>
- <TargetFileExt Value=""/>
- </General>
- <VersionInfo>
- <ProjectVersion Value=""/>
- </VersionInfo>
- <PublishOptions>
- <Version Value="2"/>
- <DestinationDirectory Value="$(TestDir)\publishedproject\"/>
- <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
- <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
- </PublishOptions>
- <RunParams>
- <local>
- <FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
- </local>
- </RunParams>
- <RequiredPackages Count="2">
- <Item1>
- <PackageName Value="fpgui_package"/>
- </Item1>
- <Item2>
- <PackageName Value="fpgfx_package"/>
- </Item2>
- </RequiredPackages>
- <Units Count="1">
- <Unit0>
- <Filename Value="listviewtest.lpr"/>
- <IsPartOfProject Value="True"/>
- <UnitName Value="listviewtest"/>
- </Unit0>
- </Units>
- </ProjectOptions>
- <CompilerOptions>
- <Version Value="5"/>
- <PathDelim Value="\"/>
- <CodeGeneration>
- <Generate Value="Faster"/>
- </CodeGeneration>
- <Other>
- <CompilerPath Value="$(CompPath)"/>
- </Other>
- </CompilerOptions>
-</CONFIG>
+<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <PathDelim Value="/"/> + <Version Value="5"/> + <General> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <IconPath Value="./"/> + <TargetFileExt Value=""/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="2"> + <Item1> + <PackageName Value="fpgui_package"/> + </Item1> + <Item2> + <PackageName Value="fpgfx_package"/> + </Item2> + </RequiredPackages> + <Units Count="1"> + <Unit0> + <Filename Value="listviewtest.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="listviewtest"/> + </Unit0> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="5"/> + <CodeGeneration> + <Generate Value="Faster"/> + </CodeGeneration> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas index cd13ccef..cda9a156 100644 --- a/src/corelib/fpgfx.pas +++ b/src/corelib/fpgfx.pas @@ -1167,8 +1167,7 @@ end; function TfpgImages.DeleteImage(const imgid: string; freeimg: boolean): boolean; var - i: integer; - img: TfpgImage; + i: integer; begin i := FImages.IndexOf(LowerCase(imgid)); if i >= 0 then diff --git a/src/corelib/gfx_extinterpolation.pas b/src/corelib/gfx_extinterpolation.pas index 633c1e49..f51152a9 100644 --- a/src/corelib/gfx_extinterpolation.pas +++ b/src/corelib/gfx_extinterpolation.pas @@ -130,8 +130,9 @@ implementation // BesselOrderOne: computes Bessel function of x in the first kind of order 0 -function J1 (x : double) : double; -const Pone : array[0..8] of double = +function J1(x: double): double; +const + Pone: array[0..8] of double = ( 0.581199354001606143928050809e+21, -0.6672106568924916298020941484e+20, 0.2316433580634002297931815435e+19, @@ -142,7 +143,7 @@ const Pone : array[0..8] of double = -0.4695753530642995859767162166e+7, 0.270112271089232341485679099e+4 ); - Qone : array [0..8] of double = + Qone: array [0..8] of double = ( 0.11623987080032122878585294e+22, 0.1185770712190320999837113348e+20, 0.6092061398917521746105196863e+17, @@ -154,8 +155,8 @@ const Pone : array[0..8] of double = 0.1e+1 ); var - p, q : double; - r : 0..8; + p, q: double; + r: byte; begin p := Pone[8]; q := Qone[8]; @@ -167,8 +168,9 @@ begin result := p / q; end; -function P1 (x : double) : double; -const Pone : array[0..5] of double = +function P1(x: double): double; +const + Pone: array[0..5] of double = ( 0.352246649133679798341724373e+5, 0.62758845247161281269005675e+5, 0.313539631109159574238669888e+5, @@ -176,7 +178,7 @@ const Pone : array[0..5] of double = 0.2111529182853962382105718e+3, 0.12571716929145341558495e+1 ); - Qone : array [0..5] of double = + Qone: array [0..5] of double = ( 0.352246649133679798068390431e+5, 0.626943469593560511888833731e+5, 0.312404063819041039923015703e+5, @@ -186,21 +188,22 @@ const Pone : array[0..5] of double = ); var x8, p, q: double; - r: 0..5; + r: byte; begin p := Pone[5]; q := Qone[5]; x8 := 8.0 / x; for r := 4 downto 0 do - begin + begin p := p*x8*x8+pOne[r]; q := q*x8*x8+Qone[r]; - end; + end; result := p / q; end; -function Q1 (x : double) : double; -const Pone : array[0..5] of double = +function Q1(x: double): double; +const + Pone: array[0..5] of double = ( 0.3511751914303552822533318e+3, 0.7210391804904475039280863e+3, 0.4259873011654442389886993e+3, @@ -208,7 +211,7 @@ const Pone : array[0..5] of double = 0.45681716295512267064405e+1, 0.3532840052740123642735e-1 ); - Qone : array [0..5] of double = + Qone : array [0..5] of double = ( 0.74917374171809127714519505e+4, 0.154141773392650970499848051e+5, 0.91522317015169922705904727e+4, @@ -218,22 +221,22 @@ const Pone : array[0..5] of double = ); var x8, p, q: double; - r : 0..5; + r: byte; begin p := Pone[5]; q := Qone[5]; x8 := 8.0 / x; for r := 4 downto 0 do - begin + begin p := p*x8*x8+pOne[r]; q := q*x8*x8+Qone[r]; - end; + end; result := p / q; end; -function BesselOrderOne (x : double) : double; +function BesselOrderOne(x: double): double; var - p, q, OneOverSqrt2, sinx, cosx: double; + p, OneOverSqrt2, sinx, cosx: double; begin if x = 0.0 then result := 0.0 @@ -261,7 +264,7 @@ end; // Functions to aid calculations -function Bessel (x : double) : double; +function Bessel(x: double): double; begin if x = 0.0 then result := PI / 4.0 @@ -269,8 +272,9 @@ begin result := BesselOrderOne(PI * x) / (2.0 * x); end; -function Sinc (x : double) : double; -var xx : double; +function Sinc(x: double): double; +var + xx: double; begin if x = 0.0 then result := 1.0 @@ -281,8 +285,9 @@ begin end; end; -function Blackman (x : double) : double; -var xpi : double; +function Blackman(x: double): double; +var + xpi: double; begin xpi := PI * x; result := 0.42 + 0.5 * cos(xpi) + 0.08 * cos(2*xpi); diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index 5554fbcd..97d040d2 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -1256,9 +1256,6 @@ begin end; procedure TfpgBaseInterpolation.Execute(x, y, w, h: integer); -var - maxy: integer; - rx, ry: integer; begin tempimage := TfpgImageBase.Create; tempimage.AllocateImage(image.ColorDepth, w, image.Height); diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas index 76b6f1ff..9f2d7c55 100644 --- a/src/corelib/x11/gfx_x11.pas +++ b/src/corelib/x11/gfx_x11.pas @@ -13,12 +13,10 @@ uses Xlib, XUtil, x11_xft, -// x11_keyconv, gfxbase, gfx_impl; type -// TfpgWinHandle = TXID; TfpgGContext = Xlib.TGc; type @@ -94,7 +92,6 @@ type FClipRect: TfpgRect; FClipRectSet: boolean; FXftDraw: PXftDraw; - FXftDrawBuffer: PXftDraw; FColorTextXft: TXftColor; FClipRegion: TRegion; FPixHeight, @@ -202,8 +199,6 @@ uses fpgfx, gfx_widget, {$Note This dependency to gfx_widget must be removed.} gui_form, // remove this!!!!! - xatom, - gfx_utf8utils, _netlayer, cursorfont, gfx_popupwindow; @@ -211,13 +206,13 @@ uses var xapplication: TfpgApplication; -const +//const // map X11 event types to custom event types - MSG_SCROLL = 65; - MSG_RESIZE = 66; - MSG_POPUPCLOSE = 67; - MSG_MOVE = 68; - MSG_DOUBLECLICK = 69; +// MSG_SCROLL = 65; +// MSG_RESIZE = 66; +// MSG_POPUPCLOSE = 67; +// MSG_MOVE = 68; +// MSG_DOUBLECLICK = 69; // some externals @@ -490,7 +485,6 @@ var n: integer; s: string; pc: PChar; - fl: TStringList; begin pfs := XftListFonts(Display, DefaultScreen, [FC_SCALABLE, FcTypeBool, 1, 0, FC_FAMILY, 0]); @@ -517,8 +511,6 @@ begin end; constructor TfpgApplicationImpl.Create(const aparams: string); -var - wa: TXWindowAttributes; begin FIsInitialized := False; FDisplay := XOpenDisplay(PChar(aparams)); @@ -635,25 +627,14 @@ procedure TfpgApplicationImpl.DoWaitWindowMessage(atimeoutms: integer); var ev: TXEvent; NewEvent: TXevent; - n: integer; i: integer; r: integer; - i2: integer; - ks: integer; - uc: word; - a: array[1..16] of char; - ss: integer; - sr: integer; - p: PChar; blockmsg: boolean; - b: boolean; w: TfpgWindowImpl; ew: TfpgWindowImpl; kwg: TfpgWidget; wh: TfpgWinHandle; wa: TXWindowAttributes; - px: integer; - py: integer; mcode: integer; msgp: TfpgMessageParams; rfds: TFDSet; @@ -1020,7 +1001,6 @@ var wh: TfpgWinHandle; attr: TXSetWindowAttributes; mask: longword; - bcolor: longword; hints: TXSizeHints; begin if FWinHandle > 0 then @@ -1139,7 +1119,7 @@ function TfpgWindowImpl.DoWindowToScreen(ASource: TfpgWindowBase; const AScreenP var dx: integer; dy: integer; - cw : TfpgWinHandle; + cw: TfpgWinHandle; begin // if not HandleIsValid then // Exit; //==> @@ -1197,29 +1177,17 @@ end; procedure TfpgWindowImpl.DoSetWindowTitle(const atitle: string); var - //s: string; - //p: PByte; netlayer: TNETWindowLayer; begin if FWinHandle <= 0 then Exit; - //s := atitle; - - //if length(s) > 0 then - //p := @s[1] - //else - //p := nil; - netlayer := TNETWindowLayer.Create(xapplication.display); try netlayer.WindowSetName(FWinHandle, PChar(ATitle)); finally netlayer.Free; end; - -// XChangeProperty(xapplication.display, FWinHandle, 39, 31, 8, 0, p, length(s)); -// XChangeProperty(xapplication.display, FWinHandle, 37, 31, 8, 0, p, length(s)); end; constructor TfpgWindowImpl.Create(AOwner: TComponent); |