An Edje compiler in Ruby

Posted at 2005-02-05

I'm currently working on an Edje compiler written in Ruby, called Redact.

What's special about it? Redact doesn't parse EDC code like the official Edje compiler, edje_cc, does. Instead, Redact sources are Ruby code as well. This gives you much more power when designing and developing Edjes compared to edje_cc.

Redact isn't publically available yet, but here's a 'port' of Ben Rockwood's crossfade Edje to Redact:

include Redact

EDJE.collections("crossfade") do |c|"background") do |p|
        p.mouse_events = true
        p.description.color = "#ffffff"
    end"rect_red") do |p|
        p.mouse_events = true

        p.description do |d|
            d.color = "#00ff0000"
            d.rel[1].set_rel(1.0, 0.0)

        p.description("default", 1.0) do |d|
            d.color = "#ff"
            d.rel[1].set_rel(1.0, 0.4)
    end"rect_green") do |p|
        p.mouse_events = true

        p.description do |d|
            d.color = "#ff000080"
            d.rel[0].set_rel(0.0, 1.0)

        p.description("default", 1.0) do |d|
            d.color = "#00ff"
            d.rel[0].set_rel(0.0, 0.6)
    end"text", Part::TYPE_TEXT) do |p|
        p.description do |d|
            d.color = "#00"

            d.text = "cuddletech"
            d.font = "Vera"
            d.font_size = 12
            d.fit_x = true
            d.fit_y = false

    c.programs("animate") do |p|
        p.signal = "mouse,clicked,1"
        p.source = "background"
        p.targets <<"rect_red"))
        p.targets <<"rect_green"))
        p.tween_mode = Program::TWEEN_MODE_ACCELERATE
        p.tween_time = 1.0

Yummy! :)

Tags , ,

Site moved to Hobix

Posted at 2005-02-04

Whoa, I moved to Hobix, why's blogging system. All the important content should be available again, if you miss anything, let me know :)


Older posts: 1 2 3 4 5 6 7