[fpc-pascal] Timer in X11

2011-12-21 Thread Felipe Monteiro de Carvalho
Hello, Does anyone know what would be the solution for implementing timer support in a X11 toolkit? I already have TTimer support implemented for LCL-CustomDrawn-Windows, Cocoa and Android (but Android is the best tested of them), but it looks like X11 has no support for timers, so I wonder what

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Henry Vermaak
On 21/12/11 11:06, Felipe Monteiro de Carvalho wrote: Hello, Does anyone know what would be the solution for implementing timer support in a X11 toolkit? I already have TTimer support implemented for LCL-CustomDrawn-Windows, Cocoa and Android (but Android is the best tested of them), but it

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Mark Morgan Lloyd
Henry Vermaak wrote: On 21/12/11 11:06, Felipe Monteiro de Carvalho wrote: Hello, Does anyone know what would be the solution for implementing timer support in a X11 toolkit? I already have TTimer support implemented for LCL-CustomDrawn-Windows, Cocoa and Android (but Android is the best

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Henry Vermaak
On 21/12/11 12:36, Mark Morgan Lloyd wrote: Henry Vermaak wrote: On 21/12/11 11:06, Felipe Monteiro de Carvalho wrote: Hello, Does anyone know what would be the solution for implementing timer support in a X11 toolkit? I already have TTimer support implemented for LCL-CustomDrawn-Windows,

Re: [fpc-pascal] FpGetRLimit and FpSetRLimit reference an undefined symbol

2011-12-21 Thread Marco van de Voort
In our previous episode, Jonas Maebe said: undefined reference to `FPC_SYSC_GETRLIMIT' Yes, it seems like a missing public alias for the FpGetRLimit function in the Linux system unit. I added it. ___ fpc-pascal maillist -

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Henry Vermaak
On 21/12/11 14:53, Felipe Monteiro de Carvalho wrote: wow, I started taking a look at how to do it and as always with anything related to X11 it is terribly complicated ... but luckly I am not alone here using FPC, so I shamelessly stole code from fpgui, hammered it a little bit to fit TTimer

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Felipe Monteiro de Carvalho
On Wed, Dec 21, 2011 at 4:53 PM, Henry Vermaak henry.verm...@gmail.com wrote: Spinning like this is bad news for efficiency and battery life of embedded devices. Well, using X11 in an embedded device by itself is a very bad choice =D And that's why it is very rare and linux-based phones don't

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Henry Vermaak
On 21/12/11 15:56, Felipe Monteiro de Carvalho wrote: On Wed, Dec 21, 2011 at 4:53 PM, Henry Vermaakhenry.verm...@gmail.com wrote: Spinning like this is bad news for efficiency and battery life of embedded devices. Well, using X11 in an embedded device by itself is a very bad choice Better

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Martin Schreiber
On 12/21/2011 04:53 PM, Henry Vermaak wrote: On 21/12/11 14:53, Felipe Monteiro de Carvalho wrote: wow, I started taking a look at how to do it and as always with anything related to X11 it is terribly complicated ... but luckly I am not alone here using FPC, so I shamelessly stole code from

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread michael . vancanneyt
On Wed, 21 Dec 2011, Henry Vermaak wrote: On 21/12/11 15:56, Felipe Monteiro de Carvalho wrote: On Wed, Dec 21, 2011 at 4:53 PM, Henry Vermaakhenry.verm...@gmail.com wrote: Spinning like this is bad news for efficiency and battery life of embedded devices. Well, using X11 in an embedded

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Henry Vermaak
On 21/12/11 16:11, Martin Schreiber wrote: On 12/21/2011 04:53 PM, Henry Vermaak wrote: On 21/12/11 14:53, Felipe Monteiro de Carvalho wrote: wow, I started taking a look at how to do it and as always with anything related to X11 it is terribly complicated ... but luckly I am not alone here

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Felipe Monteiro de Carvalho
On Wed, Dec 21, 2011 at 5:46 PM, Henry Vermaak henry.verm...@gmail.com wrote: You're still guessing a timer interval of 10ms to add to the timer if the select() doesn't time out.  So your error can be as much as 990ms per iteration of the loop.  So much for precision then. select() doesn't

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Henry Vermaak
On 21 December 2011 18:06, Marco van de Voort mar...@stack.nl wrote: Not likely with Linux-only stuff in the same msg. That's where I stopped reading pretty much. What linux only stuff? Since when does posix mean linux only? Spare us the linux phobia, please. Googling for timer_create bsd

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Martin Schreiber
On Wednesday 21 December 2011 20:10:49 Marco van de Voort wrote: I've been thinking about this myself, and if you don't want bad timers, the most logical route would be to write a scheduler implementation where the scheduler 1) in principle waits till the next registered event (events can be

Re: [fpc-pascal] inline and other modifiers

2011-12-21 Thread waldo kitty
On 12/21/2011 20:27, nore...@z505.com wrote: Also delphi is more strict when it comes to PROGRAM name parsing. In freepascal the program name can mismatch the file name, whereas delphi stops compiling and tells you error. i've never known this (program name must equal filename) to be a

Re: [fpc-pascal] inline and other modifiers

2011-12-21 Thread noreply
On 12/21/2011 20:27, nore...@z505.com wrote: Also delphi is more strict when it comes to PROGRAM name parsing. In freepascal the program name can mismatch the file name, whereas delphi stops compiling and tells you error. i've never known this (program name must equal filename) to be a

Re: [fpc-pascal] Timer in X11

2011-12-21 Thread Graeme Geldenhuys
On 21 December 2011 18:06, Henry Vermaak wrote: embedded devices, laptops have batteries, too.  You're wasting CPU and power just spinning around a loop, so even if your app isn't active, it's still waking up every 50ms.  I don't consider this very good programming practice. I'm always