[Lazarus] Printing in Linux

2010-02-15 Thread petr . kristan
Hi.

I'am working on multiplatform Win/Lin app whose main job is graphics printing.
In Windows all works ok, but in Linux output postscript is wrong. 
After little digging I found that TPoscriptCanvas is responsible for it.

I have a question about Lazarus future plans in rendering graphics output to
postscript.

Shouldn't be better to use for example Cairo than make poscript output
yourself?

Petr

-- 
Petr Kristan
.
EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice
tel: +420 466335223Czech Republic (Eastern Europe) 
fax: +420 466510709

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Having trouble getting fptimer to work in a Daemon.

2010-02-15 Thread Joshua Lim

Hi,

I'm a pascal newbie, after spending some time getting a daemon to work, I now 
have trouble getting a timer to work.  I was recommended to use TFPTimer from 
the fpTimer unit - http://mantis.freepascal.org/view.php?id=14118nbn=5

I tried the following code but the OnTimer doesn't trigger.  There are no 
errors either.  Grateful for any pointers.  :)

uses
fpTimer;
...
 TDaemon1 = class(TDaemon)

private
.
public
procedure FTimerTimer( Sender : TObject );  
.
var
  Daemon1: TDaemon1;
  FTimer : TFPTimer;
.
procedure TDaemon1.FTimerTimer( Sender : TObject );
var
...
 BEGIN

END; 

procedure TDaemon1.DataModuleStart(Sender: TCustomDaemon; var OK: boolean);
var
...
begin
 FTimer := TFPTimer.Create(nil);
 FTimer.OnTimer := @FTimerTimer;
 FTimer.Interval := 1000; // in milliseconds
 FTimer.Enabled := True; 
 FTimer.StartTimer;


Note: I've also posted here - 
http://lazarus.freepascal.org/index.php/topic,8615.0.html


  
_
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Having trouble getting fptimer to work in a Daemon.

2010-02-15 Thread Michael Van Canneyt



On Mon, 15 Feb 2010, Joshua Lim wrote:



Hi,

I'm a pascal newbie, after spending some time getting a daemon to work, I now have 
trouble getting a timer to work.  I was recommended to use TFPTimer from the 
fpTimer unit - http://mantis.freepascal.org/view.php?id=14118nbn=5


The standard driver for fpTimer is not suitable for use in a daemon
application, as the timer events are only triggered in the main thread,
and each daemon runs in its own thread.

Michael.


I tried the following code but the OnTimer doesn't trigger.  There are no 
errors either.  Grateful for any pointers.  :)

uses
fpTimer;
...
TDaemon1 = class(TDaemon)

private
.
public
   procedure FTimerTimer( Sender : TObject );
.
var
 Daemon1: TDaemon1;
 FTimer : TFPTimer;
.
procedure TDaemon1.FTimerTimer( Sender : TObject );
var
...
BEGIN

END;

procedure TDaemon1.DataModuleStart(Sender: TCustomDaemon; var OK: boolean);
var
...
begin
FTimer := TFPTimer.Create(nil);
FTimer.OnTimer := @FTimerTimer;
FTimer.Interval := 1000; // in milliseconds
FTimer.Enabled := True;
FTimer.StartTimer;


Note: I've also posted here - 
http://lazarus.freepascal.org/index.php/topic,8615.0.html



_
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing in Linux

2010-02-15 Thread Felipe Monteiro de Carvalho
On Mon, Feb 15, 2010 at 6:23 AM,  petr.kris...@epos.cz wrote:
 Shouldn't be better to use for example Cairo than make poscript output
 yourself?

The printing package is implemented by operating system rather then by
widgetset, so if you use Cairo it would only work with LCL-Gtk2 and a
new code would need to be written for LCL-Qt.

-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing in Linux

2010-02-15 Thread zeljko
On Monday 15 February 2010 14:13, Felipe Monteiro de Carvalho wrote:
 On Mon, Feb 15, 2010 at 6:23 AM,  petr.kris...@epos.cz wrote:
  Shouldn't be better to use for example Cairo than make poscript output
  yourself?

 The printing package is implemented by operating system rather then by
 widgetset, so if you use Cairo it would only work with LCL-Gtk2 and a
 new code would need to be written for LCL-Qt.

Qt can output directly to printer,postscript file  pdf file.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] xml reading problem

2010-02-15 Thread Andrea Mauri

dear all,
I have some problems reading xml files.
If I read xml files using ReadXMLFile it works only if I use:
1. procedure ReadXMLFile(out ADoc: TXMLDocument; const AFilename: 
String); overload;

while if I use
2. procedure ReadXMLFile(out ADoc: TXMLDocument; var f: Text); overload;
the program crashes.

I attached two files (acetyl.cml and acetyl2.cml). The second one is 
always read properly, the first one is read properly only if I use 
procedure 1.
In order to reproduce the error just create a new project, put a button 
and two tedit on the form.

In the button1 click put this code:

procedure TForm1.Button1Click(Sender: TObject);
var
  F: TextFile;
  FileName: String;
  XMLMolDoc: TXMLDocument;
  XMLMols: TDOMNodeList;
begin
  FileName:= Edit1.Text;
  //AssignFile(F, FileName);
  //Reset(F);
  //ReadXMLFile(XMLMolDoc, F);
ReadXMLFile(XMLMolDoc, FileName);
  XMLMols:= XMLMolDoc.GetElementsByTagName('molecule');
  edit2.text:= IntToStr(XMLMols.Count);

  //ClosefILE(F);
end;

With this code it works.

While if I put this:

procedure TForm1.Button1Click(Sender: TObject);
var
  F: TextFile;
  FileName: String;
  XMLMolDoc: TXMLDocument;
  XMLMols: TDOMNodeList;
begin
  FileName:= Edit1.Text;
  AssignFile(F, FileName);
  Reset(F);
  ReadXMLFile(XMLMolDoc, F);
  XMLMols:= XMLMolDoc.GetElementsByTagName('molecule');
  edit2.text:= IntToStr(XMLMols.Count);

  ClosefILE(F);
end;

It crashes raising: exception class 'EXMLreaderror' with message:
In 'file:///e:/temp/acetyl.cml' (line 1  pos 21): expected ?

Why?
Andrea

?xml version=1.0?
molecule id=m1 xmlns=http://www.xml-cml.org/schema;
 atomArray
  atom id=a1 elementType=O x2=4.308974 y2=3.56/
  atom id=a2 elementType=C x2=4.699250 y2=1.095897/
  atom id=a3 elementType=C x2=6.099250 y2=1.095897/
  atom id=a4 elementType=C x2=6.799250 y2=2.308333/
  atom id=a5 elementType=O x2=6.799250 y2=-0.116538/
  atom id=a6 elementType=C x2=3.876350 y2=2.228521/
  atom id=a7 elementType=C x2=2.544871 y2=1.795897/
  atom id=a8 elementType=C x2=2.544871 y2=0.395897/
  atom id=a9 elementType=C x2=1.332436 y2=-0.304103/
  atom id=a10 elementType=C x2=0.12 y2=0.395897/
  atom id=a11 elementType=C x2=0.12 y2=1.795897/
  atom id=a12 elementType=C x2=1.332436 y2=2.495897/
  atom id=a13 elementType=C x2=3.876350 y2=-0.036727/
 /atomArray
 bondArray
  bond atomRefs2=a1 a6 order=2/
  bond atomRefs2=a6 a7 order=1/
  bond atomRefs2=a6 a2 order=1/
  bond atomRefs2=a2 a3 order=1/
  bond atomRefs2=a3 a4 order=1/
  bond atomRefs2=a3 a5 order=2/
  bond atomRefs2=a7 a8 order=2/
  bond atomRefs2=a8 a9 order=1/
  bond atomRefs2=a9 a10 order=2/
  bond atomRefs2=a10 a11 order=1/
  bond atomRefs2=a11 a12 order=2/
  bond atomRefs2=a7 a12 order=1/
  bond atomRefs2=a8 a13 order=1/
  bond atomRefs2=a13 a2 order=1/
 /bondArray
/molecule
?xml version=1.0 ?
molecule id=m1
  atomArray
atom id=a1 elementType=O
  x2=0.978439526420217 y2=2.5020121905525743 /
atom id=a2 elementType=C
  x2=0.5025533550827981 y2=1.037385155458038 /
atom id=a3 elementType=C
  x2=-0.9620736800117374 y2=0.561498984120619 /
atom id=a4 elementType=C
  x2=-0.9620736800117377 y2=-0.978501015879381 /
atom id=a5 elementType=C
  x2=-2.2957528018397735 y2=-1.7485010158793814 /
atom id=a6 elementType=C
  x2=-3.629431923667809 y2=-0.9785010158793817 /
atom id=a7 elementType=C
  x2=-3.62943192366781 y2=0.5614989841206184 /
atom id=a8 elementType=C
  x2=-2.2957528018397753 y2=1.3314989841206195 /
atom id=a9 elementType=C
  x2=0.5025533550827987 y2=-1.4543871872168 /
atom id=a10 elementType=C
  x2=1.4077426436132072 y2=-0.20850101587938108 /
atom id=a11 elementType=C
  x2=2.947742643613207 y2=-0.20850101587938108 /
atom id=a12 elementType=C
  x2=3.7177426436132066 y2=1.1251781059486543 /
atom id=a13 elementType=O
  x2=3.7177426436132066 y2=-1.5421801377074167 /
  /atomArray
  bondArray
bond atomRefs2=a1 a2 order=2 /
bond atomRefs2=a2 a3 order=1 /
bond atomRefs2=a3 a4 order=2 /
bond atomRefs2=a4 a5 order=1 /
bond atomRefs2=a5 a6 order=2 /
bond atomRefs2=a6 a7 order=1 /
bond atomRefs2=a7 a8 order=2 /
bond atomRefs2=a3 a8 order=1 /
bond atomRefs2=a4 a9 order=1 /
bond atomRefs2=a9 a10 order=1 /
bond atomRefs2=a2 a10 order=1 /
bond atomRefs2=a10 a11 order=1 /
bond atomRefs2=a11 a12 order=1 /
bond atomRefs2=a11 a13 order=2 /
  /bondArray
/molecule
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing in Linux

2010-02-15 Thread petr . kristan
On Mon, Feb 15, 2010 at 11:13:12AM -0200, Felipe Monteiro de Carvalho wrote:
 On Mon, Feb 15, 2010 at 6:23 AM,  petr.kris...@epos.cz wrote:
  Shouldn't be better to use for example Cairo than make poscript output
  yourself?
 
 The printing package is implemented by operating system rather then by
 widgetset, so if you use Cairo it would only work with LCL-Gtk2 and a
 new code would need to be written for LCL-Qt.
I maybe don`t understand your answer. In Windows is rendering for
printer implemented by operating system WinAPI. But in Unix we need to render
into postscript. Now it is realised by TPoscriptCanvas which do not use
any library, but output is erroneous.

As I know, Qt has its own rendering engine (screen and printer).
For example Kylix uses it.
And I now do not know if in LCL exists TQtCanvas used by LCL-Qt.

Cairo library is multiplatform and renders into X11, Win32, PS, PDF, ... 
It do not depends on gtk. 
Dependency is reversed -- new Gtk2 uses Cairo to render widgets.
For example WebKit and Firefox3 uses this library on all platforms.
http://en.wikipedia.org/wiki/Cairo_(graphics)

What about to make TCairoCanvas and use it by default in LCL-Gtk2.
IMHO generated postscript output should be better then TPoscriptCanvas
makes.

TCairoCanvas (certainly with corresponding library) can be useful in other 
platforms. 
Rendering into PDF, SVG or PNG may be convenience to anybody.

Petr

-- 
Petr Kristan
.
EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice
tel: +420 466335223Czech Republic (Eastern Europe) 
fax: +420 466510709

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing in Linux

2010-02-15 Thread Felipe Monteiro de Carvalho
On Mon, Feb 15, 2010 at 12:14 PM,  petr.kris...@epos.cz wrote:
 Cairo library is multiplatform and renders into X11, Win32, PS, PDF, ...
 It do not depends on gtk.

Yes, but it adds an external dependency which would need to be
deployed with software that uses it, and Lazarus cannot impose such
restriction in everyone that uses it. That's why it would only be used
in LCL-Gtk2, as it already depends on Cairo

 What about to make TCairoCanvas and use it by default in LCL-Gtk2.
 IMHO generated postscript output should be better then TPoscriptCanvas
 makes.

We still need to hear other developers, but sure, I guess if you
implement a TCairoCanvas and contribute it, and it works better then
the current method, then it will be added and used for LCL-Gtk2. We
can keep the current postscript canvas for other UNIXes, even if after
that a Qt-specific method is added, because then it can be used for
other UNIX widgetsets that may be added one day (fpgui, for example)

thanks,
-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] xml reading problem

2010-02-15 Thread Marco van de Voort
On Mon, Feb 15, 2010 at 02:48:40PM +0100, Andrea Mauri wrote:

 I attached two files (acetyl.cml and acetyl2.cml). The second one is 
 always read properly, the first one is read properly only if I use 
 procedure 1.
 In order to reproduce the error just create a new project, put a button 
 and two tedit on the form.
 In the button1 click put this code:

I think you have found a bug.

Please convert the examples to working console programs, and attach them
to a bugreport in Mantis. (and the acetyl* files as well)
 

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Bug ou Característica do Lazarus | L azarus Bug or Feature

2010-02-15 Thread Guionardo Furlan
Buenas pessoal

Ainda estou com este probleminha chato da IDE

Quando tenho um componente, digamos, não-default, por exemplo algum
da rx ou um componente que eu mesmo criei, a compilação funciona
perfeitamente, sinal que o FPC e seus diretórios estão configurados
adequadamente.
Mas a IDE sempre dá problemas com unit não encontrada, mesmo que eu
declare a dependência do pacote do componente, inclua sua unit no .lpr
do projeto e defina os diretórios onde estão as units necessárias.
Quando vou editar o fonte do projeto, fazendo qualquer referência às
units/classes dos componentes, a IDE (codetools) apresenta o erro que
indiquei.
Só dá certo se eu abrir o fonte das units do componente.

Já testei com diversas versões do laz/fpc, svn, x86, x64, inclusive
testei uma máquina virtual com windows xp limpa e o problema persiste.


Alguém já verificou este problema?
Será algum poltergheist?

---

Google Translate:

Buenas staff

I'm still with this annoying little problem of the IDE

When I have a component, say, no default, for example some of rx or
a component that I created myself, the build works perfectly, a sign
that the FPC and their directories are configured properly.
But the IDE always gives problems with unit not found even if I
declare a dependency on the component package, include your unit on
.lpr and set the directory where the units are needed.
When I edit the source of the project, making no reference to units /
classes of components, IDE (CodeTools) has pointed out the error.
It only works if I open the source of the component units.

Already tested with several versions of laz / fpc, svn, x86, x64, even
tried a virtual machine with clean windows xp and the problem
persists.


Has anyone found this problem?
Can it be any poltergheist?

-- 
Timeo hominem unius libri
Cogito ergo sum - Carpe diem

[]s
Guionardo Furlan
http://guionardo.blogspot.com
http://www.guionardofurlan.com.br

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] xml reading problem

2010-02-15 Thread Andrea Mauri



Please convert the examples to working console programs, and attach them
to a bugreport in Mantis. (and the acetyl* files as well)


ok, but I have to report it as a bug for fpc category FCL?
thanks,
andrea

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] cannot understand popup menu and form not-closing

2010-02-15 Thread JoshyFun
Hello Lazarus-List,

Monday, February 15, 2010, 10:36:53 AM, you wrote:

RP I'm using caFree, but the application does not close, unless something
RP is shown; for example, a showmessage box or bettere a Form1.show.
RP However I set the form to be minimized, not showing in taskbar and
RP with width=height=0, so it doesn't flash.
RP But I think it is a workround.

So it looks to something different, but maybe related in some way.

RP I also tried to handle the WM_SHOWWINDOW, and my routine is actually
RP called, however the problem is not solved. Maybe I was just reacting
RP to the message, without consuming it. What do you think ?

I doubt that as the comsume of the event is a must which happends with
or without your handle.

RP Shall I submit a bug report ?

Yes, but it is important in this case to provide a sample application
that raises the bug, either by clicking something (or a sequence of
things to do) or by programatically trigger the unexpected behavior.
Post only the source codes in the bug tracker, not the exe ;)

-- 
Best regards,
 JoshyFun


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] xml reading problem

2010-02-15 Thread Andrea Mauri

Il 15/02/2010 16.31, Andrea Mauri ha scritto:



Please convert the examples to working console programs, and attach them
to a bugreport in Mantis. (and the acetyl* files as well)






I reported it as Bug 0015776 [FPC] FCL
Thanks,
andrea

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] How to use ExceptProc and application.CaptureExceptions

2010-02-15 Thread Alexander Grau

Hello,

I'm trying to turn off application exception capturing (so I can send 
exception traces via HTTP in bug reports):


1) In (the first loaded unit of) a console app, I did override 
ExceptProc (see code at bottom) - my own handler is called (as expected) 
on a EDivByZero exception.


2) In my Lazarus LCL app (SVN 23483M,  LCL/Win32/i386, fpc 2.4.0), I did 
the same like in the console app - additionally, I did set 
Application.CaptureExceptions to 'false':


 Application.Initialize;
 Application.CreateForm(TForm1, Form1);
 application.CaptureExceptions:=false;
 Application.Run;

Now, when a EDivByZero is raised, my own handler is *not* called - 
instead the default TApplication.HandleException is called - To my 
surprise...
a) When raised before Application.Run, my own handler is called (as it 
should).
b) When I debug Application.Run, it correctly uses the case without 
exception handling(!) - that is, it correctly detects the 
CaptureExceptions change.
c) When I read ExceptProc right before the exception, it correctly has 
the value of my own handler(!)


Though, my own handler is never called within Application.Run - and I 
have no idea why...


Any help or ideas are welcome!

Thanks,
Alexander


---Console output

install
application.CaptureExceptions=0
TApplication.HandleException Division by zero
 Stack trace:
 $00420413  CRASHME,  line 39 of unit1.pas
 $0042047A  TFORM1__BUTTONCRASHMECLICK,  line 46 of unit1.pas
 $004C6234  TCONTROL__CLICK,  line 2294 of ./include/control.inc
 $004FA26F  TBUTTONCONTROL__CLICK,  line 72 of ./include/buttoncontrol.inc
 $004FA745  TCUSTOMBUTTON__CLICK,  line 164 of ./include/buttons.inc
 $004FACA1  TBUTTON__CLICK,  line 331 of ./include/buttons.inc
 $004FA10A  TBUTTONCONTROL__WMDEFAULTCLICKED,  line 26 of 
./include/buttoncontrol.inc

 $0040A84A
 $004BCE72  TWINCONTROL__WNDPROC,  line 5102 of ./include/wincontrol.inc
 $0050FCC7  DELIVERMESSAGE,  line 111 of lclmessageglue.pas
 $004DB6B0  WINDOWPROC,  line 2621 of win32callback.inc
 $77D18709
 $77D187EB
 $77D1B743
 $77D1B7AB
 $773C6FF6
 $773C70D8

---My exception handler-

procedure MyExceptionHandler(
 Obj : TObject;   // ExceptObject
 Addr: Pointer;   // ExceptAddr
 FrameCount: Longint; // ExceptFrameCount
 Frames: PPointer // ExceptFrames
);
begin
 writeln('MyExceptionHandler');
 ShowException(obj, addr);
end;


initialization
 writeln('install');
 exceptproc := @MyExceptionHandler;




--

Mit freundlichen Grüßen/Best regards
Alexander Grau

Grau GbR
Hardware  Software Solutions
Eschenweg 12
32609 Huellhorst
Germany

www.grauonline.de
Tel: +49 (0) 5741 2301259
Fax: +49 (0) 5741 235530
E-Mail: i...@grauonline.de



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] xml reading problem

2010-02-15 Thread Sergei Gorelkin

Andrea Mauri wrote:


I reported it as Bug 0015776 [FPC] FCL
Thanks,
andrea


Fixed in r14919.

Note, however, that using TextFile-based ReadXMLFile overloaded variant is somewhat discouraged, 
because it is slower than other variants and is not able to handle utf-16 encodings.


Sergei

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] JEDI code formatting

2010-02-15 Thread Guionardo Furlan
Well, I see another problem:

jcf doesn't recognize operator overloading.

2010/2/13 Bernd Kreuss prof7...@googlemail.com:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Paul Ishenin wrote:

 If the bug is fixed in the JCF code repository then I will update
 lazarus version. I do this from time to time.

 I have found the bug and fixed it. Here is the fix:

 C:\lazarus\components\jcf2\Process\Indent\Indenter.pas
 starting in line 113:

 function InGlobalTypeOrVarSection(const pt: TSourceToken): Boolean;
 begin
   // are we in a type or var section?
   if not pt.HasParentNode([nTypeSection, nVarSection]) then
   begin

 change this to:

 function InGlobalTypeOrVarSection(const pt: TSourceToken): Boolean;
 begin
   // are we in a type or var section?
   // EXPERIMENTAL: added CONST section to this list,
   // maybe rename the whole function now? It is used only once.
   if not pt.HasParentNode([nTypeSection, nVarSection, nConstSection]) then
   begin

 This is only called once near the end of the file at line 638 and seems
 to be part of another prior bugfix. The bug in the bugfix 1898723 and my
 fix for the fix will only ever happen if the setting indent for
 procedures in library is DISabled, else all this code won't be executed
 at all.

 I'll continue to test this a bit although I think it is safe and could
 already be sent upstream.

 Bernd
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iD8DBQFLdq2ixT6R4jlFoh0RArzKAJ96SN143sG8RpPTJzT4AS8mWKRFIwCffITQ
 m5r/8Z7sz7uont0zX0oAWQA=
 =E/5A
 -END PGP SIGNATURE-

 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




-- 
Timeo hominem unius libri
Cogito ergo sum - Carpe diem

[]s
Guionardo Furlan
http://guionardo.blogspot.com
http://www.guionardofurlan.com.br

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Strip problems

2010-02-15 Thread JoshyFun
Hello Lazarus-List,

I'm used to use a:

strip program.exe --strip-all

Before releasing an exe, as it is quite easy operation, but since a
few weeks (maybe some months) strip can not remove all extra
information in the exe file.

I have activated the -g and -gl flags to generate debug information in
the exe file, and this is how the exe sections appear:

Object table:
#   Name  VirtSizeRVA PhysSize  Phys off  Flags
--            
01  .text 00116B90  1000  00116B90  0400  60500020 [CER]
02  .data 0004B8D8  00118000  0004B8D8  00117000  C0500040 [IRW]
03  .bss  7054  00164000      C0500080 [URW]
04  .idata2A08  0016C000  2A08  00162A00  C0300040 [IRW]
05  .rsrc 1F78  0016F000  1F78  00165600  C0500040 [IRW]
06  /400304232  00171000  00304232  00167600  0210 [D]
07  /16   0021E233  00476000  0021E233  0046BA00  0210 [D]
08  /30   0005A3B4  00695000  0005A3B4  00689E00  0210 [D]
09  /42   0002CDBC  006F  0002CDBC  006E4200  0230 [D]
0a  .stab 0014DAA4  0071D000  0014DAA4  00711000  0230 [D]
0b  .stabstr  00852873  0086B000  00852873  0085EC00  0210 [D]

Which is more or less the expected, except that I do not know what are
the /4, /16, /30 and /42 sections. The exe size is around 18 MB.

If I run the strip-all command I get:

Object table:
#   Name  VirtSizeRVA PhysSize  Phys off  Flags
--            
01  .text 00116B90  1000  00116C00  0400  6020 [CER]
02  .data 0004B8D8  00118000  0004BA00  00117000  C040 [IRW]
03  .bss  7054  00164000      C080 [URW]
04  .idata2A08  0016C000  2C00  00162A00  C040 [IRW]
05  .rsrc 1F78  0016F000  2000  00165600  5040 [ISR]
06  /400304232  00171000  00304400  00167600  C020 [CRW]
07  /16   0021E233  00476000  0021E400  0046BA00  C020 [CRW]
08  /30   0005A3B4  00695000  0005A400  00689E00  C020 [CRW]
09  /42   0002CDBC  006F  0002CE00  006E4200  C020 [CRW]

And sections starting with / are not being removed and the exe size
is around 7 MB.

Now unchecking the -g and -gl flags I get:

Object table:
#   Name  VirtSizeRVA PhysSize  Phys off  Flags
--            
01  .text 001153B0  1000  001153B0  0400  60500020 [CER]
02  .data 0004B848  00117000  0004B848  00115800  C0500040 [IRW]
03  .bss  5404  00163000      C0500080 [URW]
04  .idata29F0  00169000  29F0  00161200  C0300040 [IRW]
05  .rsrc 1F78  0016C000  1F78  00163C00  C0500040 [IRW]

Which is the expected result and exe size around 1.7 MB.

I had tried to issue a:

strip program.exe --remove-section=/4 without success. Does this means
that the strip is not usable anymore or that sections should not be
there or have different flags ?

I'm using fpc SVN, Lazarus SVN and WinXP SP3.

Thank you.

-- 
Best regards,
 JoshyFun


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing in Linux

2010-02-15 Thread Jesus Reyes
   Shouldn't be better to use for example Cairo than
 make poscript output
   yourself?

It has pros and cons, on the nice side a very big amount of programming would 
be reused which means a better quality on output but it does impose a library 
dependency on application. I don't see that as a impossible obstacle though, on 
windows application deployment may include needed libraries (problems that 
comes with this approach are beyond of this topic) and on Linux needed 
libraries are usually already installed.

  
  The printing package is implemented by operating
 system rather then by
  widgetset, so if you use Cairo it would only work with
 LCL-Gtk2 and a
  new code would need to be written for LCL-Qt.
 I maybe don`t understand your answer. In Windows is
 rendering for
 printer implemented by operating system WinAPI. But in Unix
 we need to render
 into postscript. Now it is realised by TPoscriptCanvas
 which do not use
 any library, but output is erroneous.

It may be independent of GTK2.

 
 As I know, Qt has its own rendering engine (screen and
 printer).
 For example Kylix uses it.
 And I now do not know if in LCL exists TQtCanvas used by
 LCL-Qt.

Printer support is already implemented for Qt, and if we want to support GTK 
native printer dialogs we need to implement a cairo canvas anyway.

 
 Cairo library is multiplatform and renders into X11, Win32,
 PS, PDF, ... 
 It do not depends on gtk. 
 Dependency is reversed -- new Gtk2 uses Cairo to render
 widgets.
 For example WebKit and Firefox3 uses this library on all
 platforms.
 http://en.wikipedia.org/wiki/Cairo_(graphics)
 
 What about to make TCairoCanvas and use it by default in
 LCL-Gtk2.
 IMHO generated postscript output should be better then
 TPoscriptCanvas
 makes.

I been playing with this for long time, but every time there is something more 
to do, of course a patch would be welcome.

 
 TCairoCanvas (certainly with corresponding library) can be
 useful in other platforms. 
 Rendering into PDF, SVG or PNG may be convenience to
 anybody.
 
 Petr
 
 -- 
 Petr Kristan
 

Jesus Reyes A.


  Encuentra las mejores recetas en Yahoo! Cocina.   
http://mx.mujer.yahoo.com/cocina/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing in Linux

2010-02-15 Thread Jesus Reyes

  into postscript. Now it is realised by
 TPoscriptCanvas
  which do not use
  any library, but output is erroneous.

Forgot to ask, what is erroneous on output?
if it's a bug submit a bug report maybe we can improve it.

Jesus Reyes A.


  Encuentra las mejores recetas en Yahoo! Cocina.   
http://mx.mujer.yahoo.com/cocina/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Hiding Comments

2010-02-15 Thread theo
I know this is probably hard to implement but I sometimes would really
like to have it. ;-)
I have some heavily commented code, be it for the following reasons.
- Comments explaining what the following code is doing, sometimes line
by line.
- Comments which keep some thoughts of previous implementations in
code (not for shipping) but which might be helpful and be it only for
not going that route again.
- Some todo stuff (I know about the todo feature).

I think it would be helpful to hide all comments at times, because while
helpful, they make reading the actually working code a lot harder.

Does anybody know if this is implemented somewhere in other IDEs?
Does anybody else think this would be a good feature?
Does anybody have a suggestion how to implement this?

Don't beat me, it's just a question and I have no answer. ;-)

Thanks


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Hiding Comments

2010-02-15 Thread Paul Nicholls
- Original Message - 
From: theo x...@theo.ch

To: lazarus@lists.lazarus.freepascal.org
Sent: Tuesday, February 16, 2010 11:28 AM
Subject: [Lazarus] Hiding Comments



I know this is probably hard to implement but I sometimes would really
like to have it. ;-)
I have some heavily commented code, be it for the following reasons.
- Comments explaining what the following code is doing, sometimes line
by line.
- Comments which keep some thoughts of previous implementations in
code (not for shipping) but which might be helpful and be it only for
not going that route again.
- Some todo stuff (I know about the todo feature).

I think it would be helpful to hide all comments at times, because while
helpful, they make reading the actually working code a lot harder.

Does anybody know if this is implemented somewhere in other IDEs?
Does anybody else think this would be a good feature?
Does anybody have a suggestion how to implement this?

Don't beat me, it's just a question and I have no answer. ;-)

Thanks


+10

cheers,
Paul

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] JEDI code formatting

2010-02-15 Thread Paul Ishenin

16.02.2010 3:02, Guionardo Furlan wrote:

Well, I see another problem:

jcf doesn't recognize operator overloading.


Actually, this was implemented. Can you give an example of code which is 
not recognized?


Best regards,
Paul Ishenin.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Hiding Comments

2010-02-15 Thread theo
Paul Nicholls? This Paul Nicholls?
http://www.efg2.com/Lab/Library/UseNet/1999/0806.txt
;-)


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Strip problems

2010-02-15 Thread Paul Ishenin

16.02.2010 3:03, JoshyFun пишет:

Hello Lazarus-List,

I'm used to use a:

strip program.exe --strip-all

Before releasing an exe, as it is quite easy operation, but since a
few weeks (maybe some months) strip can not remove all extra
information in the exe file.


I'd suggest to use -Xg option. You will have no debug symbols in the 
executable but have them in a separate file for gdb only. This way you 
can just take your exe for releasing.


I must admit that strip indeed does not work for my executables with 
dwarf debug info.


Best regards,
Paul Ishenin.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Hiding Comments

2010-02-15 Thread Paul Nicholls
- Original Message - 
From: theo x...@theo.ch

To: lazarus@lists.lazarus.freepascal.org
Sent: Tuesday, February 16, 2010 12:54 PM
Subject: Re: [Lazarus] Hiding Comments



Well, then welcome on board (if nobody else said that before).
How is the weather like in Australia? ;-)



Thanks :)

it is a lovely sunny 24 degrees here in Tasmania, Australia, very nice :)

cheers,
Paul

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Hiding Comments

2010-02-15 Thread theo
 it is a lovely sunny 24 degrees here in Tasmania, Australia, very nice :)

Humm, it's -10 (Celsius) here in central Switzerland.
Swiss Intl. Air Lines offers three flights to Hobart tomorrow.
Two via Hongkong-Sydney one via Bangkok-Sydney.
Which one to take?
;-)


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Hiding Comments

2010-02-15 Thread Thierry Coq

Hello all,

I join theo in asking for such features, my emphasis is on having more 
structured comments embedded in the code. For example, storing the 
design model, requirements, or traceability to the design and 
requirements. Of course, this would be awkward to manage if a feature 
like the one theo asks is not available. Even better, if there were a 
system to manage the structure of the comments (and turn them on/off), 
maybe in some XML-like syntax...


For example, I would love to be able to mention the Big-O notation of 
the algorithms in a structured manner that can be recovered 
automatically, and can be optionally hidden in the code when not useful.


Best regards,
Thierry

theo wrote:

I know this is probably hard to implement but I sometimes would really
like to have it. ;-)
I have some heavily commented code, be it for the following reasons.
- Comments explaining what the following code is doing, sometimes line
by line.
- Comments which keep some thoughts of previous implementations in
code (not for shipping) but which might be helpful and be it only for
not going that route again.
- Some todo stuff (I know about the todo feature).

I think it would be helpful to hide all comments at times, because while
helpful, they make reading the actually working code a lot harder.

Does anybody know if this is implemented somewhere in other IDEs?
Does anybody else think this would be a good feature?
Does anybody have a suggestion how to implement this?

Don't beat me, it's just a question and I have no answer. ;-)

Thanks


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


  



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Hiding Comments

2010-02-15 Thread Graeme Geldenhuys
Hello Theo,

 I think it would be helpful to hide all comments at times, because while
 helpful, they make reading the actually working code a lot harder.


That's why I prefer external documentation like is done with FPC and
Lazarus projects - using XML files.

Alternatively, keep most of your comments above the
method/function/procedure. If you want to hide them automatically, simply
wrap them with {%region} so it enables code-folding.

eg:

 {%region 'comments hidden by default' -fold}
 { This is my very long comment that goes on for many lines...}
 {%endregion}
 procedure MyProc;
 begin
   ...
 end;


The '-fold' in the %region line will tell the IDE to code-fold than region
by default. I use this for all code auto-generated and managed by fpGUI's
UI Designer.


The last solution is to simply not comment your code! Make it the next
developers problem. :-)


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Hiding Comments

2010-02-15 Thread Graeme Geldenhuys
theo wrote:
 
 I think it would be helpful to hide all comments at times, because while
 helpful, they make reading the actually working code a lot harder.

I just thought of another solution. Change your editor preferences and
change the foreground and background color for comments to be the same as
the editor background. All comments are now invisible. ;-)



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus