Re: [fpc-pascal] Blind Users

2016-10-26 Thread Felipe Monteiro de Carvalho
Some work was done in the LCL-Cocoa and LCL-Win32 to support screen
readers. Since LCL-Win32 uses native controls, it should be acessible
to screen readers out of the box, but it would be great if you could
test how the LCL apps behave in practice. I tested a long time ago.

About UI designing, I think it is best if you bypass the Form designer
completely and write the UI in code instead. Here is an example of how
to write LCL GUIs in code only, without using the Form Designer:

http://wiki.freepascal.org/Form_Tutorial#Creating_a_new_form_dynamically

Also read this page about acessibility in general and specifically
about adding accessibility to custom control (non-native ones) in the
LCL: http://wiki.lazarus.freepascal.org/LCL_Accessibility

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] inherited interfaces not seen by queryinterface / supports

2016-10-26 Thread Graeme Geldenhuys
On 2016-10-27 03:47, Graeme Geldenhuys wrote:
> Again, I don't know why it is done like this, and works very different
> to class inheritance. Delphi 7 works exactly the same in this regard.
> Maybe somebody with more knowledge on the subject could shed some light.

I did some quick internet searching. According to Danny Thorpe (an ex
Borland employee I believe), the reason Delphi works so "weird"
regarding Interface Inheritance, is because Delphi is very Windows
centric, and initially Delphi Interfaces were COM compatible interfaces.
Microsoft made some screw-up in COM, and Delphi followed suite.

  http://stackoverflow.com/a/4380371


"The reason is because COM and ActiveX allow an implementation to
implement a descendent interface (your IChild) but deny the ancestor of
that interface (IParent). Since Delphi interfaces are intended to be COM
compatible, that's where this goofy artifact comes from." -- Danny Thorpe


Now my question to the FPC developers are... For a long time now,
Interface support does not always mean COM or ActiveX support, so why
still does FPC do the same as Delphi? And even worse, why does this same
behaviour happen in FPC's CORBA style interfaces - which has *nothing*
to do with COM or ActiveX???

Here as a FPC (CORBA style interfaces) example of the problem with
Interface Inheritance.


program Project1;

  {$mode objfpc}{$H+}
  {$interfaces corba}

uses
  SysUtils;

type
  IOne = interface
  ['{32271879-1C00-4A02-A9C0-6948844028D6}']
procedure One;
  end;

  ITwo = interface(IOne)
  ['{F3027177-6638-4984-B842-7D4E70299056}']
procedure Two;
  end;

  TMyObject = class(TObject, ITwo) //  << IOne is not specified
  private
// IOne interface
procedure One;
// ITwo interface
procedure Two;
  end;

procedure TMyObject.One;
begin
  writeln('One');
end;

procedure TMyObject.Two;
begin
  writeln('Two');
end;

var
  o: TMyObject;
  i1: IOne;
  i2: ITwo;
begin
  o := TMyObject.Create;
  if Supports(o, ITwo, i2) then
i2.Two;
  if Supports(o, IOne, i1) then  // this is never true
i1.One;
  i2 := nil;
  i1 := nil;
  o.Free;
end.



In the Stack Overflow link I posted - further down the page - a person
named Jasper mentions that in is QueryInterface implementation bug where
QueryInterface on checks for valid Interface signatures in the top level
of the interface hierarchy, and doesn't actually check for inherited
interfaces.  Anyway, read Jasper's comment to see his exact words.

   http://stackoverflow.com/a/39496815


If nothing else, surely FPC's CORBA style interfaces should not
implement the COM style interface bug?

Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] inherited interfaces not seen by queryinterface / supports

2016-10-26 Thread Graeme Geldenhuys
On 2016-10-27 02:13, David Emerson wrote:
>t_2 = class (_obj_type_, i_2)
>  // i_2 inherits from i_1, compiler requires i_1 implementation
>  procedure do_one;
>  procedure do_two;
>  end;


A common misconception about how interfaces work. In fact, I don't
actually know why FPC and Delphi bother with Interface Inheritance,
because I simply don't see the point.

To make your "t_2" class support both interface, you need to specify
both in the class declaration. Even though i_2 inherits from i_1, both
i_1 and i_2 must be specified in the t_2 class.

Again, I don't know why it is done like this, and works very different
to class inheritance. Delphi 7 works exactly the same in this regard.
Maybe somebody with more knowledge on the subject could shed some light.

Here is a D7 example:

===
program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  IOne = interface
  ['{32271879-1C00-4A02-A9C0-6948844028D6}']
procedure One;
  end;

  ITwo = interface(IOne)
  ['{F3027177-6638-4984-B842-7D4E70299056}']
procedure Two;
  end;

  {  If you only specify ITwo here, then the second Supports() call
 for i1.One will never execute. }
  TMyObject = class(TInterfacedObject, IOne, ITwo)
  private
// IOne interface
procedure One;
// ITwo interface
procedure Two;
  end;

procedure TMyObject.One;
begin
  writeln('One');
end;

procedure TMyObject.Two;
begin
  writeln('Two');
end;

var
  o: TMyObject;
  i1: IOne;
  i2: ITwo;
begin
  o := TMyObject.Create;
  if Supports(o, ITwo, i2) then
i2.Two;
  if Supports(o, IOne, i1) then
i1.One;
  i2 := nil;
  i1 := nil;

end.

===


Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Can I open XZ compressed text file on the fly?

2016-10-26 Thread Graeme Geldenhuys
On 2016-10-26 14:58, Gabor Boros wrote:
> Can I open it 
> without decompress it to the file system

Yes, simply use any component that implements the LZMA/LZMA2 compression
algorithms. You should then be able to decompress it in memory. I think
the TurboPower Abbrevia components on SourceForge support that. There
are probably other compression components that you can use too.

Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] inherited interfaces not seen by queryinterface / supports

2016-10-26 Thread David Emerson

Hi all,

I am a bit perplexed / disappointed to see that the Supports / 
QueryInterface functions for interfaces are not behaving the way I would 
expect them to behave, when using an interface that inherits from 
another interface.


note, _obj_type_ might be TObject, TInterfacedObject, or TComponent.

{$mode objfpc}

type
  i_1 = interface
['{6C8CF001-733C-4A2D-B41F-3B3FF1D266B4}']
procedure do_one;
end;

  i_2 = interface (i_1)
['{E0F0FA05-96C3-4979-A58C-5FB5F1E37214}']
procedure do_two;
end;

  t_2 = class (_obj_type_, i_2)
// i_2 inherits from i_1, compiler requires i_1 implementation
procedure do_one;
procedure do_two;
end;

var
  two : t_2;

It seems that Supports (two, i_1) returns false -- even though Supports 
(two, i_2) returns true, and i_2 inherits from i_1. QueryInterface 
similarly fails (for COM interfaces)


It appears to me that the only way to get a proper i_1 result from these 
functions is to define


  t_2 = class (_obj_type_, i_2, i_1)

This is redundant, and a burden when there is a hierarchy of inherited 
interfaces defined in different places.


Is there some other way, some mode or switch or something, that would 
make a class definition automatically include interface-supports for 
inherited interfaces?


(Also, in the source below there are a couple Access Violation crashes 
noted, any ideas why?)


Thanks!
~David.

Free Pascal Compiler version 3.0.0 [2015/12/05] for x86_64 (linux - debian)

Here's my full program:

program inherit_intf;

{$mode objfpc}{$H+}
{$macro on}

{$define corba}
//{$define tcomp}
//{$define tintobj}

{$ifdef corba}
  {$interfaces corba}
  {$define _intf_str_ := 'CORBA'}
{$else COM interface}
  {$interfaces com}
  {$define _intf_str_ := 'COM'}
  {$ifndef tcomp}
{$define tintobj}
  {$endif}
{$endif}

{$ifdef tcomp}
  {$define _obj_type_ := TComponent}
  {$define _obj_str_ := 'TComponent'}
  {$define _create_param_ := nil}
{$else}
  {$define _create_param_ := }
  {$ifdef tintobj}
{$define _obj_type_ := TInterfacedObject}
{$define _obj_str_ := 'TInterfacedObject'}
  {$else}
{$define _obj_type_ := TObject}
{$define _obj_str_ := 'TObject'}
  {$endif not tintobj}
{$endif tcomp}


uses
  classes,
  sysutils;

type
  i_1 = interface
['{6C8CF001-733C-4A2D-B41F-3B3FF1D266B4}']
procedure do_one;
end;

  i_2 = interface (i_1)
['{E0F0FA05-96C3-4979-A58C-5FB5F1E37214}']
procedure do_two;
end;

  t_2 = class (_obj_type_, i_2)
procedure do_one;
procedure do_two;
end;

  t_3 = class (t_2, i_1)
end;

procedure t_2.do_one;
  begin
writeln ('one');
  end;

procedure t_2.do_two;
  begin
writeln ('two');
  end;

var
  two : t_2;
  three : t_3;
  res : i_1;

begin
  writeln (_intf_str_, ' / ', _obj_str_);
  two := t_2.Create (_create_param_);
  three := t_3.Create (_create_param_);
  writeln ('t_2 supports i_1? ', supports (two, i_1, res)); // 
unexpectedly FALSE

  writeln ('t_3 supports i_1? ', supports (three, i_1, res)); // TRUE
  {$ifndef corba}
writeln ('t_2 QueryIntf i_1? ', S_OK = two.QueryInterface (i_1, 
res)); // unexpectedly FALSE
writeln ('t_3 QueryIntf i_1? ', S_OK = three.QueryInterface (i_1, 
res)); // TRUE for TComponent. CRASH - SIGSEGV for COM + TInterfacedObject

  {$endif}
  two := three;
  writeln ('t_3 (t_2 var) supports i_1? ', supports (two, i_1, res)); 
// TRUE for TComponent. CRASH - SIGSEGV with COM + TInterfacedObject

end.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Blind Users

2016-10-26 Thread BobJ

Graeme,

Thanks, I'll take a look.

Bob


--
From: "Graeme Geldenhuys" 
Sent: Wednesday, October 26, 2016 4:23 AM
To: 
Subject: Re: [fpc-pascal] Blind Users


On 2016-10-25 12:30, BobJ wrote:

Any guidance will be appreciated.


Fred has done some very impressive work with SAK - his Speech Assistive
Kit. SAK works cross-platform too, and supports fpGUI Toolkit and MSEgui.

Here is a short write-up on it with using fpGUI.

 http://fpgui.sourceforge.net/community.shtml

The project website and source code can be found on GitHub.

 https://github.com/fredvs/sak

Fred has also made a fully assistive fpGUI Visual Form's Designer and a
fork of MSEide, called ideU, which you can use to develop Console,
MSEgui or fpGUI applications.

The ideU releases url:

 https://github.com/fredvs/ideU/releases

Just looking at the SAK github page, it seems he managed to get a LCL
version going to.

Regards,
 Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 3.0 for ARM (v7l) ?

2016-10-26 Thread Paul Breneman

On 10/26/2016 12:05 PM, Ched wrote:

Hello,

I just received a brand new Raspberry 3B. Nice ARM-based quad-core
pico-machine (armv7l).

I can run on the 3B programs compiled on a Raspberry 2B (armv6l) using
the 2.6.4 fpc compiler.
But compiling on the 3B with the 2.6.4 generates errors, like

u_astro.s: Assembler messages:
u_astro.s:2810: Error: co-processor offset out of range
u_astro.s:2821: Error: co-processor offset out of range
u_astro.s:3185: Error: co-processor offset out of range
u_astro.s:3196: Error: co-processor offset out of range.

So I tried to find a 3.* version to install, without success. Any
suggestion ? Rebuilding all from sources is most probably out of my
capabilities, hélas.

Kindest regards, Ched'


I would suggest using fpcup:
  http://wiki.freepascal.org/fpcup
See the bottom link (Small Virtual Machines) to see what I've done with it.

Regards,
Paul
www.ControlPascal.com


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] fpc 3.0 for ARM (v7l) ?

2016-10-26 Thread Ched

Hello,

I just received a brand new Raspberry 3B. Nice ARM-based quad-core pico-machine 
(armv7l).

I can run on the 3B programs compiled on a Raspberry 2B (armv6l) using the 
2.6.4 fpc compiler.
But compiling on the 3B with the 2.6.4 generates errors, like

u_astro.s: Assembler messages:
u_astro.s:2810: Error: co-processor offset out of range
u_astro.s:2821: Error: co-processor offset out of range
u_astro.s:3185: Error: co-processor offset out of range
u_astro.s:3196: Error: co-processor offset out of range.

So I tried to find a 3.* version to install, without success. Any suggestion ? Rebuilding all from 
sources is most probably out of my capabilities, hélas.


Kindest regards, Ched'
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] what is the possible cause of EPrivilege Privileged instruction ?

2016-10-26 Thread Dennis Poon



Snorkl e wrote:


Your not using teventobject in your threads are you?
There is a bug in the RTL which could cause weird issues with threads 
if you are using teventobject.create.




I don't use TEventObject (because I don't know how to use it).
I have my internal task queue that my worker thread loop through the 
task queue.

The exception was raised within one of the many tasks in the task queue.

Dennis
On Oct 26, 2016 10:58 AM, "Dennis" > wrote:


I have a multi threaded program which executes a list of tasks in
real time.
It is difficult to debug with a debugger on this program (since
debugging will pause the execution which will be messy for this
application).

So, I log the exceptions to a log file and I found this exception:
EPrivilegePrivileged instruction

What could possibly raise this exception?

My program is win 32 from Lazarus 1.7  FPC 3.1.1
and running on Win 7 64 bit.

thanks in advance.

Dennis
___
fpc-pascal maillist  - fpc-pascal@lists.freepascal.org

http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] what is the possible cause of EPrivilege Privileged instruction ?

2016-10-26 Thread Snorkl e
Your not using teventobject in your threads are you?
There is a bug in the RTL which could cause weird issues with threads if
you are using teventobject.create.

On Oct 26, 2016 10:58 AM, "Dennis"  wrote:

> I have a multi threaded program which executes a list of tasks in real
> time.
> It is difficult to debug with a debugger on this program (since debugging
> will pause the execution which will be messy for this application).
>
> So, I log the exceptions to a log file and I found this exception:
> EPrivilegePrivileged instruction
>
> What could possibly raise this exception?
>
> My program is win 32 from Lazarus 1.7  FPC 3.1.1
> and running on Win 7 64 bit.
>
> thanks in advance.
>
> Dennis
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] what is the possible cause of EPrivilege Privileged instruction ?

2016-10-26 Thread Tony Whyman

A couple of ideas (no more than this)

1. A corrupt stack has resulted in a function return address being 
corrupted and the program jumps to an illegal instruction.


2. Executing data (shouldn't really happen).

3. Corrupt VMT sgain resulting in the program jumping to an illegal 
instruction.


The problem with these type of bugs is that cause and effect can be some 
way apart. I tend to debug multi-threaded programs that are mis-behaving 
by having lots of writeln statements and then looking at the output log 
to see which patterns of behaviour lead to the problem. Can be an art 
rather than a science.



On 26/10/16 16:57, Dennis wrote:
I have a multi threaded program which executes a list of tasks in real 
time.
It is difficult to debug with a debugger on this program (since 
debugging will pause the execution which will be messy for this 
application).


So, I log the exceptions to a log file and I found this exception:
EPrivilegePrivileged instruction

What could possibly raise this exception?

My program is win 32 from Lazarus 1.7  FPC 3.1.1
and running on Win 7 64 bit.

thanks in advance.

Dennis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] what is the possible cause of EPrivilege Privileged instruction ?

2016-10-26 Thread Dennis

I have a multi threaded program which executes a list of tasks in real time.
It is difficult to debug with a debugger on this program (since 
debugging will pause the execution which will be messy for this 
application).


So, I log the exceptions to a log file and I found this exception:
EPrivilegePrivileged instruction

What could possibly raise this exception?

My program is win 32 from Lazarus 1.7  FPC 3.1.1
and running on Win 7 64 bit.

thanks in advance.

Dennis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Can I open XZ compressed text file on the fly?

2016-10-26 Thread Gabor Boros

Hi All,

I need to analyze log file but its compressed with XZ. Can I open it 
without decompress it to the file system or can decompress in memory for 
example into a TStringList?


Gabor
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Blind Users

2016-10-26 Thread Fred van Stappen
Hello.


Thanks Graeme for your clear explanations.


sak (Speaker Assitive Kit) is working for LCL, fpGUI and MSEgui.


Here demo of sak in action:


https://sites.google.com/site/designerext/test_sak_mse_fred.mp4


ideU is a voice assisted IDE, derived from MSEide.


Binary release for Windows, Linux and FreeBSD are here:


https://github.com/fredvs/ideU/releases


Fre;D



De : fpc-pascal-boun...@lists.freepascal.org 
 de la part de Graeme Geldenhuys 

Envoyé : mercredi 26 octobre 2016 10:23
À : fpc-pascal@lists.freepascal.org
Objet : Re: [fpc-pascal] Blind Users

On 2016-10-25 12:30, BobJ wrote:
> Any guidance will be appreciated.

Fred has done some very impressive work with SAK - his Speech Assistive
Kit. SAK works cross-platform too, and supports fpGUI Toolkit and MSEgui.

Here is a short write-up on it with using fpGUI.

  http://fpgui.sourceforge.net/community.shtml
Community Projects - fpGUI Toolkit
fpgui.sourceforge.net
Community Projects. Here you will find any interesting projects created by the 
community, using fpGUI in some or other way. If you have a project that you 
would like ...




The project website and source code can be found on GitHub.

  https://github.com/fredvs/sak
[https://avatars2.githubusercontent.com/u/3421249?v=3&s=400]

GitHub - fredvs/sak: Speecher Assistive Kit. With sak 
...
github.com
Speecher Assistive Kit. With sak, your application becomes assistive directly, 
without changing anything in your code.




Fred has also made a fully assistive fpGUI Visual Form's Designer and a
fork of MSEide, called ideU, which you can use to develop Console,
MSEgui or fpGUI applications.

The ideU releases url:

  https://github.com/fredvs/ideU/releases
[https://avatars2.githubusercontent.com/u/3421249?v=3&s=400]

fredvs/ideU
github.com
ideU - The ide. Universal.




Just looking at the SAK github page, it seems he managed to get a LCL
version going to.

Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
fpGUI Toolkit
fpgui.sourceforge.net
What is fpGUI? fpGUI Toolkit (or the Free Pascal GUI Toolkit) is a 
multi-platform toolkit for creating graphical user interfaces. Offering a 
complete set of custom ...




My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
fpc-pascal Info 
Page
lists.freepascal.org
NOTE * Due to incidents with spambots subscribing to the list and spamming 
it, your first message(s) may be delayed a bit before ...



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Blind Users

2016-10-26 Thread Graeme Geldenhuys
On 2016-10-25 12:30, BobJ wrote:
> Any guidance will be appreciated.

Fred has done some very impressive work with SAK - his Speech Assistive
Kit. SAK works cross-platform too, and supports fpGUI Toolkit and MSEgui.

Here is a short write-up on it with using fpGUI.

  http://fpgui.sourceforge.net/community.shtml

The project website and source code can be found on GitHub.

  https://github.com/fredvs/sak

Fred has also made a fully assistive fpGUI Visual Form's Designer and a
fork of MSEide, called ideU, which you can use to develop Console,
MSEgui or fpGUI applications.

The ideU releases url:

  https://github.com/fredvs/ideU/releases

Just looking at the SAK github page, it seems he managed to get a LCL
version going to.

Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal