[MacRuby-devel] Project status, goals, and other non-technical info

2009-02-27 Thread Giampiero De Ciantis
Hi All,

I am wondering where there is a page that keeps track of what the
goals of the project are,  what the next milestone is, and so on. Is
there anything like this available? Does some one have it in their
head?

Would love to know.

-Gp
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Porting Cocoa OpenGL sample code

2009-02-27 Thread Julien Jassaud

Brian,

Thanks for the very detailed answer. This tremendously helps. I am now  
having problems with arrays, though. I try to make a pointer to an  
array of 32 longs, like this :


>> p = Pointer.new_with_type('[32L]')
=> #
>> p[0]
ArgumentError: can't convert C/Objective-C value `0x80052ae40' of type  
`[32i]' to Ruby object

from (irb):49:in `[]'
from (irb):49
from /usr/local/bin/macirb:12:in `'

Am I not getting the syntax explained in the documentation page you  
mentioned ?


Also, something is puzzling me. In C, arrays are pointers so I thought  
I could solve the problem (and it works) by doing :


>> p=Pointer.new_with_type('^L')
=> #
>> p.assign([1,2,3])
=> [1, 2, 3]
>> p[0][1]
=> 2

Great ! I have a pointer to something that looks like an array of  
longs (and it seems to satisfy the CGGetActiveDisplayList function).  
But how is it possible when everything here is an object and not a  
series of neatly aligned bytes ?


Anyway, you are right. The part of Cocoa OpenGL I am porting now  
probably doesn't need to and should be wrapped in an Objective-C object.


Thanks,
Julien Jassaud

Le 26 févr. 09 à 05:43, Brian Chapados a écrit :


Can you explain: "^{_CGLRendererInfoObject=}"? is that some secret
incantation only known by the MacRuby/Obj overlords?


Yes, it is actually a 7th level spell: 'Encode Structure'.  To learn
it, you must study the ancient tome:
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/chapter_7_section_1.html#/ 
/apple_ref/doc/uid/TP40008048-CH100-SW1


If it makes you feel better, I usually need to look it up (or just
run the Obj-C code sample), unless it is something simple (like '@').
I don't keep this spell in memory, as it is only required in special
situations.

Seriously though, that is actually how you encode a pointer to a
struct.  If you use the @encode(type) directive, the compiler will
return the runtime encoding for 'type'.  It's a bit cryptic, but not
too bad once you know the syntax:

'^type' encodes a pointer to type.
'{name=...}'
encodes a struct with N fields.

To break it down using 2 examples:

(from the docs)
typedef struct example {
   id   anObject; // encoding = @
   char *aString; // encoding = c
   int  anInt; // enoding = i
} Example;

@encode(Example) = "^{examp...@ci}"

CGLRendererInfoObj is a pointer to an opaque struct (we don't know
anything about the fields) named _CGLRendererInfoObject. All we know
is:
typedef struct _CGLRendererInfoObject *CGLRendererInfoObj;

so it's just "^{_CGLRendererInfoObject=}"

In practice (unless you're working with CoreFoundation C APIs) you
usually just need a pointer to an object.  The most common usage I run
across is to retrieve NSError objects.  The CoreFoundation C API uses
pass-by-reference extensively.  To use these functions with MacRuby,
you need to create lots of pointer objects. In general, this is an
area where interfacing ruby with C is just fugly.  I'd personally
avoid doing this in MacRuby.  If you find yourself needing to use lots
Pointer objects, it's probably better and less error-prone to write
that code in C and expose it to MacRuby through an Objective-C
interface.

That said, for common things, I've used something like this extension
to the Pointer class:


class Pointer
 def self.ptr
   new_with_type("@")
 end

 def self.to(type = :object)
   case type
 when :object
   new_with_type('@')
 when :int
   new_with_type('i')
 when :char
 when :bool
 when :BOOL
   new_with_type('c')
 when :unsigned
   new_with_type('I')
   end
 end

 def value
   self[0]
 end
end



Need a pointer to an ObjC object?
p = Pointer.ptr

To a BOOL?
p = Pointer.to(:BOOL)

Need the value?
p.value

Those are the most common types I've needed.

On Wed, Feb 25, 2009 at 11:11 AM, Matt Aimonetti
 wrote:

Brian, what's up with this syntax: info =
Pointer.new_with_type("^{_CGLRendererInfoObject=}")
Can you explain: "^{_CGLRendererInfoObject=}"? is that some secret
incantation only known by the MacRuby/Obj overlords?
Thanks,
- Matt

On Wed, Feb 25, 2009 at 10:13 AM, Brian Chapados   
wrote:


CGLRendererInfo is a pointer to a struct:
   typedef struct _CGLRendererInfoObject *CGLRendererInfoObj;

try creating a pointer to void or to the struct:

info = Pointer.new_with_type("^v")  # void *info;

or

info = Pointer.new_with_type("^{_CGLRendererInfoObject=}") #
CGLRendererInfo *info

I think the second one is effectively the same as what you were  
trying

to do with:
info = Pointer.new_with_type("CGLRendererInfoObj")

except that the runtime doesn't know what to do with
"CGLRendererInfo".  The argument to Pointer.new_with_type must be a
valid Objective-C type encoding[1].

[1]:
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/chapter_7_section_1.html#/ 
/apple_ref/doc/uid/TP40008048-CH100-SW1


If you are ever in doubt about what encoding to use, you can always
compile a small Objective-C

[MacRuby-devel] Project status, goals, and other

2009-02-27 Thread Tim Rand
> The macruby website has a timeline for project goals. Here is the link

http://www.macruby.org/trac/wiki/MacRubyRoadmap
I am very excited that the IO rewrite is on the chopping block for 0.5.
Tim
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] new example + new HotCocoa mapping

2009-02-27 Thread Matt Aimonetti
MacRuby/HotCocoa sample with download, progress bar, scroll view/text view
and new HotCocoa mapping:   http://bit.ly/hThh9

I added a new mapping for NSProgressIndicator and put a pretty realistic
example of what you would do in real life:

1. download a file
2. show the progress
3. display the content of the download in a scroll view

I hope this will end up being useful for people wanting to get started with
HotCocoa but don't really know where to start.

- Matt
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] new example + new HotCocoa mapping

2009-02-27 Thread Matt Aimonetti
And here is a quick video showing the end result:
http://screencast.com/t/5nAHRHQjL

100% Ruby (Well... 100% MacRuby with HotCocoa).

 -Matt

On Fri, Feb 27, 2009 at 2:02 PM, Matt Aimonetti wrote:

> MacRuby/HotCocoa sample with download, progress bar, scroll view/text view
> and new HotCocoa mapping:   http://bit.ly/hThh9
>
> I added a new mapping for NSProgressIndicator and put a pretty realistic
> example of what you would do in real life:
>
> 1. download a file
> 2. show the progress
> 3. display the content of the download in a scroll view
>
> I hope this will end up being useful for people wanting to get started with
> HotCocoa but don't really know where to start.
>
> - Matt
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] new example + new HotCocoa mapping

2009-02-27 Thread Laurent Sansonetti

Very nice work Matt :)

Is there a way to easily generate a patch against MacRuby trunk  
somewhere from your github repository?


Laurent

On Feb 27, 2009, at 3:17 PM, Matt Aimonetti wrote:


And here is a quick video showing the end result: 
http://screencast.com/t/5nAHRHQjL

100% Ruby (Well... 100% MacRuby with HotCocoa).

 -Matt

On Fri, Feb 27, 2009 at 2:02 PM, Matt Aimonetti > wrote:
MacRuby/HotCocoa sample with download, progress bar, scroll view/ 
text view and new HotCocoa mapping:   http://bit.ly/hThh9


I added a new mapping for NSProgressIndicator and put a pretty  
realistic example of what you would do in real life:


1. download a file
2. show the progress
3. display the content of the download in a scroll view

I hope this will end up being useful for people wanting to get  
started with HotCocoa but don't really know where to start.


- Matt

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] new example + new HotCocoa mapping

2009-02-27 Thread Matt Aimonetti
Thanks Laurent, I'll check with git-svn and see what I can do to generate
proper svn patches from my repo.  (I also need to centralize everything in
my repo)

- Matt

On Fri, Feb 27, 2009 at 9:33 PM, Laurent Sansonetti
wrote:

> Very nice work Matt :)
>
> Is there a way to easily generate a patch against MacRuby trunk somewhere
> from your github repository?
>
> Laurent
>
> On Feb 27, 2009, at 3:17 PM, Matt Aimonetti wrote:
>
> And here is a quick video showing the end result:
> http://screencast.com/t/5nAHRHQjL
>
> 100% Ruby (Well... 100% MacRuby with HotCocoa).
>
>  -Matt
>
> On Fri, Feb 27, 2009 at 2:02 PM, Matt Aimonetti 
> wrote:
>
>> MacRuby/HotCocoa sample with download, progress bar, scroll view/text view
>> and new HotCocoa mapping:   http://bit.ly/hThh9
>>
>> I added a new mapping for NSProgressIndicator and put a pretty realistic
>> example of what you would do in real life:
>>
>> 1. download a file
>> 2. show the progress
>> 3. display the content of the download in a scroll view
>>
>> I hope this will end up being useful for people wanting to get started
>> with HotCocoa but don't really know where to start.
>>
>> - Matt
>>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Project status, goals, and other

2009-02-27 Thread Laurent Sansonetti

Hi Tim and Giampiero,

The roadmap is still pretty well what we would like to achieve, the  
only problem is that 0.4 should have been released a few months ago :- 
( I changed the wiki page and in theory 0.4 should be out soon, I will  
start working on this this week-end.


We need to reorganize the project's organization too. I have been  
recently neglecting the maintenance of it as well as failing to give  
status updates. Once 0.4 is released I really want to fix that and if  
people want to help they are greatly welcomed.


On the list of organizational changes, we should have an official  
repository on github (we will also keep the SVN repository in sync),  
hoping that it will be easier for the community to contribute changes.  
Also we will have a new website that should be more community- 
friendly, featuring a more active blog and short articles (or recipes).


We will also start working on 0.5, which will be a very big release. I  
will merge some preliminary work that I have done and we will make a  
list of things that should be completed for that release.


If you have any idea or proposition please do not hesitate to drop  
them also.


Laurent

On Feb 27, 2009, at 1:28 PM, Tim Rand wrote:



The macruby website has a timeline for project goals. Here is the link
http://www.macruby.org/trac/wiki/MacRubyRoadmap

I am very excited that the IO rewrite is on the chopping block for  
0.5.

Tim
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel