Re: [fpc-pascal] Apple development tools

2010-09-10 Thread Helmut Hartl

 Am 09.09.10 15:45, schrieb Jonas Maebe:

On 09 Sep 2010, at 15:31, Mark Morgan Lloyd wrote:


I've just had my attention drawn to this elsewhere, and thought it
would be of general interest.

"In particular, we are relaxing all restrictions on the development
tools used to create iOS apps, as long as the resulting apps do not
download any code. This should give developers the flexibility they
want, while preserving the security we need.

Perfect! FPC-compiled apps are once again allowed by the new SDK
agreement:

That is very nice ! Because my company is currently working on an
large "business application" OpenGL Engine Framework "coded like a game 
engine"
for visualizing network traffic and reporting in 3D with heavy use of 
shaders,

physics and FPC.
iOS for iPAD and iPhone was on our list of targeted platforms,
and is now again.


"Developers should be testing and developing their apps in line with
the iOS Developer Program License Agreement. Should you have any
questions or concerns, we request that you review the iOS Developer
Program License Agreement details with your own legal counsel. You may
view a copy of the latest agreement via the Member Center - Your
Account area:"

I didn't bother to actually check whether there was a new agreement (I
figured it was just a boiler plate for "go away"), but given this
development it does seem that it was grouped with all other objections
to that change...

I got the same reply to my mail from April, and interpreted it the same
(negative) way. But now things seem to move ...

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


[fpc-pascal] Anybody know X11 and XDND (drag-n-drop)

2010-09-10 Thread Graeme Geldenhuys
Hi,

I'm having trouble fetching the XdndTypeList data. It works 100% on my
32-bit Linux laptop, but now trying on my 64-bit Linux desktop at
work, the XGetWindowProperty() call under 64-bit linux for the
XdndTypeList always returns count = 0, when in fact it should be 8, as
my last section of the output shows. I simply forced count = 8,
because I knew Nautilus has that many types, and wanted to see if my
array of TAtom's actually contains the data - which it does!  So it
does seem to fetch the data, it just doesn't report it in the
variables: actualformat, count, remaining.

Anybody got experience with this and know how I can resolve this problem?


type
  AtomArray = array [0..0] of TAtom;
  PAtomArray = ^AtomArray;
var
  s: string;
  actualtype: TAtom;
  actualformat: Integer;
  count, remaining, dummy: longword;
  xdndtypes: PAtomArray;

begin
...
XGetWindowProperty(fpgApplication.Display, FSrcWinHandle,
XdndTypeList, 0, dummy,
TBool(False),
AnyPropertyType,
@actualtype, @actualformat, @count, @remaining,
@xdndtypes);
s := XGetAtomName(fpgApplication.Display, actualtype);
writeln(Format('  ActualType: %s (%d)', [s, ActualType]));
writeln('  Actualformat = ', ActualFormat);
writeln('  count = ', count);
writeln('  remaining = ', remaining);


 [ output of my test program ]
XdndEnter event received!
  ver(4) check-XdndTypeList(True) data=1E0E816h,67108865,0,0,0
  * We will be using XDND v4 protocol *
  ** We need to fetch XdndTypeList (>3 types)

Actual fetch:  -
  ActualType: ATOM (4)
  Actualformat = 0
  count = 0   <---  
  remaining = 0

Force the count size to be eight: --
  Format #1 = x-special/gnome-icon-list (564)
  Format #2 = text/uri-list (531)
  Format #3 = UTF8_STRING (283)
  Format #4 = COMPOUND_TEXT (463)
  Format #5 = TEXT (464)
  Format #6 = STRING (31)
  Format #7 = text/plain;charset=utf-8 (465)
  Format #8 = text/plain (466)





-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Anybody know X11 and XDND (drag-n-drop)

2010-09-10 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> I'm having trouble fetching the XdndTypeList data. It works 100% on my
> 32-bit Linux laptop, but now trying on my 64-bit Linux desktop at
> work, the XGetWindowProperty() call under 64-bit linux for the
> XdndTypeList always returns count = 0, when in fact it should be 8, as
> my last section of the output shows. I simply forced count = 8,
> because I knew Nautilus has that many types, and wanted to see if my
> array of TAtom's actually contains the data - which it does!  So it
> does seem to fetch the data, it just doesn't report it in the
> variables: actualformat, count, remaining.

You are not passing unix types, and are passing pointers to 32-bit types to
parametesr that expect pointers to 64-bit types (pculong).

Since they are on the stack, they probably overwrite eachother. As always
with 64-bit, pay great care to the typing.

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


Re: [fpc-pascal] Anybody know X11 and XDND (drag-n-drop)

2010-09-10 Thread Henry Vermaak
On 10 September 2010 09:08, Graeme Geldenhuys  wrote:
> Hi,
>
> I'm having trouble fetching the XdndTypeList data. It works 100% on my
> 32-bit Linux laptop, but now trying on my 64-bit Linux desktop at
> work, the XGetWindowProperty() call under 64-bit linux for the
> XdndTypeList always returns count = 0, when in fact it should be 8, as
> my last section of the output shows. I simply forced count = 8,
> because I knew Nautilus has that many types, and wanted to see if my
> array of TAtom's actually contains the data - which it does!  So it
> does seem to fetch the data, it just doesn't report it in the
> variables: actualformat, count, remaining.
>
> Anybody got experience with this and know how I can resolve this problem?
>
>
> type
>  AtomArray = array [0..0] of TAtom;
>  PAtomArray = ^AtomArray;
> var
>  s: string;
>  actualtype: TAtom;
>  actualformat: Integer;
>  count, remaining, dummy: longword;
>  xdndtypes: PAtomArray;

You should use the ctypes here, since they'll change for 64 bit.

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


Re: [fpc-pascal] Anybody know X11 and XDND (drag-n-drop)

2010-09-10 Thread Graeme Geldenhuys
On 10 September 2010 10:18, Marco van de Voort wrote:
>
> You are not passing unix types, and are passing pointers to 32-bit types to
> parametesr that expect pointers to 64-bit types (pculong).

Oops!  Thanks Marco, changing them to ctypes solved the problem. I
better double check my other X11 code too, I might be making the same
mistake in a few more place. :-/

Finally got fpGUI-X11 drag-n-drop to work! :-)


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Anybody know X11 and XDND (drag-n-drop)

2010-09-10 Thread Graeme Geldenhuys
On 10 September 2010 10:38, Henry Vermaak wrote:
>
> You should use the ctypes here, since they'll change for 64 bit.

Thanks Henry, that was indeed the problem.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Generic B+Trees, Lists and Vectors

2010-09-10 Thread Honza
With tests and documentation. Requires trunk FPC.
Download: http://code.google.com/p/fprb/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Generic B+Trees, Lists and Vectors

2010-09-10 Thread Felipe Monteiro de Carvalho
I would recommend listing it here:
http://wiki.lazarus.freepascal.org/Components_and_Code_examples#Packages_for_FPC.2FLazarus_.28not_hosted_here.29

thanks,

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


[fpc-pascal] HookSignal, "halt", and unhandled exceptions

2010-09-10 Thread Seth Grover
Greetings! An interesting problem I've run into:

Under Linux, I have a small example program written in C (we'll call
it cprog) which uses a FPC-compiled shared object library
(libfpcso1.so) inside which I want to catch access violations in
try/except blocks. I don't care about access violations in the C
program, and by "don't care" I mean "don't care if it halts the
program."

Thanks to HookSignal(RTL_SIGDEFAULT) (see
http://www.freepascal.org/docs-html/rtl/sysutils/hooksignal.html) once
the .so installs its signal handler, catching the exceptions in the
try/except blocks works beautifully.

However, if a segfault is raised in cprog, strange behavior happens.
The FPC signal handler catches the signal, and goes into the "handle
unhandled exception" code, which is what I wou
ld expect. It raises a runtime error 217, which is what I would
expect. However, it does not halt the program. What actually happens
is it gets into an infinite loop of raising runtime error 217. Here's
the output. Note that the first 3 lines of output are me testing that
the exceptions are handled correctly in the try/except block in the
.so, which they are. Then my c program causes a segfault, after which
I get the infinity r.e. 217 output:

===
$ ./cprog

handled inside so 2: Access violation
handled inside so 2: Division by zero
called libc, handled inside so 2: Access violation

An unhandled exception occurred at $08048534 :
EAccessViolation : Access violation
  $08048534 line 50 of cprog.c

Runtime error 217 at $F7761740
  $F7761740
  $F77617B4
  $F7783DA5
  $F77647FE
  $F75D1BD6
  $08048431

Runtime error 217 at $F7761740
  $F7761740
  $F77617B4
  $F7783DA5
  $F77647FE
  $F75D1BD6
  $08048431

An unhandled exception occurred at $F77617EF :
EAccessViolation :
  $F77617EF
  $F7783DA5
  $F77647FE

Runtime error 217 at $F7761740
  $F7761740

Runtime error 217 at $F7761740
  $F7761740

Runtime error 217 at $F7761740
  $F7761740

Runtime error 217 at $F7761740
  $F7761740

An unhandled exception occurred at $F77617EF :
EAccessViolation :
  $F77617EF
  $F7783DA5
  $F77647FE
  $F7783DA5
  $F77647FE

Runtime error 217 at $F7761740
... (at this point it continues like this forever)
===

It seems the cause of this is that halt, which calls InternalExit and
System_exit, which in turn calls haltproc, does not actually halt the
program in the case of a library. Instead, haltproc for the library
just calls InternalExit again and returns.

I took my test case to an even simpler one, and simple removed the
try/except block around the access violation in my test .so. So now,
all my test C program is call libfpcso1.so's "crash" function and I
get the infinite loop of r.e. 217's, never returning to the main
program at all.

I understand that it's only possible to have one signal handler
installed at a time (which, in this example, I'm perfectly happy with;
HookSignal does exactly what I want), but it seems wrong that an
unhandled exception in a library should cause your program to go into
an infinite loop, rather than doing the same thing an unhanded
exception would do in an executable.

Thoughts? Should I log it as a bug?

Thanks,

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
sethdgrover[at]gmail[dot]com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Question mark?

2010-09-10 Thread Luis Fernando Del Aguila Mejía
In the following program:

{$ Codepage UTF8}
var str: string;
Begin
 Readln (str);
 Writeln (str)
End.

When I enter the following: €uro, shows me: ?uro.
The console uses 850 and S.O. 1252, for non-Unicode programs.
My question is:
Who puts the question mark?
The widestring manager or my console.

thank you___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] COM/OLE with fpc 2.5.1

2010-09-10 Thread Johannes Nohl
Dear list

Can someone summarize the status of COM / OLE in Windows using recent
versions of freepascal? As far as I got: COM clients are possible
since 2.4.0. You can use them for i.e. Office automatisation. It
works. But what about COM servers?

Is programming i.e. Office possible without using Delphi now? Can I
even create an Office Add-In? Does anybody know a resource for
information? There're tons of Delphi specific examples out there. But
nothing fpc related.

Can you help? Thanks.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] HookSignal, "halt", and unhandled exceptions

2010-09-10 Thread Jonas Maebe

On 10 Sep 2010, at 18:58, Seth Grover wrote:

> It seems the cause of this is that halt, which calls InternalExit and
> System_exit, which in turn calls haltproc, does not actually halt the
> program in the case of a library. Instead, haltproc for the library
> just calls InternalExit again and returns.

It's probably caused by r14184, which was in response to 
http://bugs.freepascal.org/view.php?id=14958

The problem is probably that the lib's exit code is called both when the 
library is unloaded (in which case you don't want the process to terminate) and 
when the "library" terminates (either via an unhandled exception, or by calling 
halt). I can't say off-hand how to decouple them, but a patch would be welcome.


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Question mark?

2010-09-10 Thread Jonas Maebe

On 10 Sep 2010, at 20:21, Luis Fernando Del Aguila Mejía wrote:

> In the following program:
> 
> {$ Codepage UTF8}
> var str: string;
> Begin
> Readln (str);
> Writeln (str)
> End.
> 
> When I enter the following: €uro, shows me: ?uro.
> The console uses 850 and S.O. 1252, for non-Unicode programs.
> My question is:
> Who puts the question mark?
> The widestring manager or my console.

It can be either, but it's probably the widestring manager in this case (it 
uses a question mark to replace characters that cannot be represented in the 
current character set; this is detected by the OS' widestring manager returning 
an error, or in certain cases the the OS' widestring conversion routines 
themselves will replace unrepresentable characters with '?').

If you are on a Unix platform, remember to add the "cwstring" unit to your uses 
clause.


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: HookSignal, "halt", and unhandled exceptions

2010-09-10 Thread Seth Grover
Jonas wrote:

> It's probably caused by r14184, which was in response to 
> http://bugs.freepascal.org/view.php?id=14958
> The problem is probably that the lib's exit code is called both when the 
> library is unloaded
> (in which case you don't want the process to terminate) and when the 
> "library" terminates
> (either via an unhandled exception, or by calling halt). I can't say off-hand 
> how to decouple them,
> but a patch would be welcome.
> Jonas

Hm, I see what you mean. I'm going to be on vacation for the next two
weeks (up in the mountains away from computers, electricity, etc.) but
I'll ruminate on it while I'm gone.

In the meanwhile I've logged a mantis issue to track:
http://bugs.freepascal.org/view.php?id=17383

Have a good weekend,

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
sethdgrover[at]gmail[dot]com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Question mark?

2010-09-10 Thread Luis Fernando Del Aguila Mejía
ok, thanks for your response.
But I believed that the Widestring manager, are routines that are included in 
the compiled program. But you mention that there is an "OS widestring manager". 
I'm confused, how many widestring manager exist?.

For example, when I write this statement:
  Writeln ('привет'); / / Hello in Russian

The widestring manager, convert the string to six question marks. its ok.
But, What Widestring manager, makes the task?.

Thank you.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal