World: r3wp
[Red] Red language group
older newer | first last |
Dockimbel 2-Feb-2012 [4714] | You can freely cast any pointer type to any other pointer type (struct and c-string are part of any-pointer! internal typeset). |
Oldes 2-Feb-2012 [4715x2] | I would prefere to be able simply define: MagickRelinquishMemory: "MagickRelinquishMemory" [return: [any-pointer!]] which would accept c-string!, struct!, pointer! [byte!], pointer! [integer!] etc.. |
sorry.. MagickRelinquishMemory: "MagickRelinquishMemory" [resource [any-pointer!]] | |
Dockimbel 2-Feb-2012 [4717x2] | You can already have it: #define any-pointer! byte-ptr! |
Ah you want implicit casting...sorry. | |
Oldes 2-Feb-2012 [4719] | But it's true I can use: MagickRelinquishMemory as-c-string query where query is an array... just it's not so clear |
Dockimbel 2-Feb-2012 [4720x2] | You should rather use byte-ptr! (which is more "generic" than c-string!) as return type for MagickRelinquishMemory and cast values to byte-ptr! when required. |
Pull request #201: Oldes, thank you very much for your changes. It should be ok now for merging, I will just run a few more tests before that. | |
Kaj 2-Feb-2012 [4722x5] | Oldes, I had the same problem as you with the generic memory freeing routine in the C library, so I use this define: |
#define free-any [free as-binary ] | |
Which uses this in turn: | |
#define binary! [pointer! [byte!]] #define as-binary [as binary! ] | |
Instead of pointer! [byte!] you could use byte-ptr! now, as Doc said | |
Dockimbel 2-Feb-2012 [4727x2] | Enumeration branch from Oldes merged to float-partial branch. Thank to Oldes for this nice addition and quality work! |
I will update the language spec document to include #enum description. | |
Kaj 2-Feb-2012 [4729x3] | Kaj: I gave a new try on making the GTK+ binding work on Linux/ARM, I was able to track the crash up to the call to `gtk-append-container` from `gtk-window` function. The argument values passed are: window: 0006C000 value: 12 which results in a Runtime Error 1: access violation (segfault) |
Here's the code line: | |
gtk-append-container as gtk-container! window as gtk-widget! value | |
Dockimbel 2-Feb-2012 [4732] | Also, with this contribution comes an ImageMagick library binding! |
Kaj 2-Feb-2012 [4733x2] | Cool :-) |
value is supposed to be a widget object, so the 12 is bogus | |
Dockimbel 2-Feb-2012 [4735] | Good! At least we have a clue to follow. |
Kaj 2-Feb-2012 [4736] | What's the source code that generates this? |
Dockimbel 2-Feb-2012 [4737] | gtk-view label "Hello, Red/System GTK+ world!" |
Kaj 2-Feb-2012 [4738x3] | The code is executed in this case: |
either any-struct? type [ either as-logic value [ | |
That's correct, because the label generates the widget object to be added to the window container | |
Dockimbel 2-Feb-2012 [4741] | Right, I've added a lot of debug logs to GTK to follow the calls...(the planned stack trace feature for Red/System is climbing in priority) |
Kaj 2-Feb-2012 [4742x3] | So type seems to be correct, but value is not the label object. At a guess, could value = type ? |
They're set like this, so I expect a bug there: | |
type: list/type value: list/value | |
Dockimbel 2-Feb-2012 [4745] | Right, I need to check the generated code for that part... |
Kaj 2-Feb-2012 [4746] | Guessing further, did you maybe swap type and value in the struct when adding 64 bits floats? |
Dockimbel 2-Feb-2012 [4747x5] | Yes I have, but the bug is older than that change. |
And the swapping should be transparent. | |
I think there's definitely a stack offsetting bug in the ARM backend for typed/variadic functions. | |
Kaj, I've been able to reproduce a similar behavior (having 12 in list/value instead of an address) using a small program, I'm analyzing it right now. | |
I have fixed the bug (issue with variadic function's return value), but it is still crashing. It seems the real issue is that callbacks are not stable on ARM...I haven't found the time to properly test them, so I'll need to do it now. Fortunately, Andreas has joined the bug hunting party. :-) | |
Kaj 3-Feb-2012 [4752] | Good progress |
Pekr 5-Feb-2012 [4753x2] | What's your experience with Red/System wrapping interface? Is it suitable to wrap (relatively saying) "any" C defines? I am recently scripting VLC a bit, to see if I can use that player instead of LED Studio (which is really bad chinese standard LED accompanying sw) for our LED screen. So far, I am fine talking to VLC via TCP - 10 lines of Rebol code. But their RC (remote control interface) missess advanced playlist handling. I was looking into vlccore library API, and I found various wrappers, and e.g. Python one, is auto-generated, by going thru includes. IIRC, Max worked on something similar for R3, but never released the code. Now I wonder, how difficult would it be to achieve using Red/System? |
btw - VLC natively supports LUA, so I will also look, if it can't do more, than what is being exposed via RC interface ... | |
Kaj 5-Feb-2012 [4755x4] | Red/System's way to write bindings is the best I've seen. Barring C features it doesn't have yet, it should be able to bind any C function. Mostly only 64 bits integers and importing data values are still missing by now |
I've been considering a VLC binding, but it isn't a priority for me right now | |
One issue with it is that VLC is GPL, even the library, so your code on top of it must be open source. If you don't want that, the remote programming is the way to go | |
It would be a problem for an R3 binding, because the GPL doesn't allow VLC and REBOL to run in the same process | |
Pekr 5-Feb-2012 [4759] | VLC library is going to be LGPL since 1.2, or I have read something like that. Anyway - I have basic remote thing working. That damned thing can't do so simple stuff as viewing jpg images, nor I can have transition effects, so I am considering another alternatives ... |
Kaj 6-Feb-2012 [4760x2] | I missed the LGPL relicensing. That's really cool |
That makes a Red binding much more interesting | |
Pekr 6-Feb-2012 [4762] | VLC is weak in my book - sorry that it belongs to vent most probably, but that player can't replay something as simple, as jpg or png files. How can they expect ppl using their solution to build player upon it? Every old LCD TV can replay images, VLC can't. Nor it has transition effects ... |
Kaj 6-Feb-2012 [4763] | It's a video stream player, not an image viewer |
older newer | first last |