The Artima Developer Community
Sponsored Link

PHP Buzz Forum
Hello world in Gtk Javascript

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Alan Knowles

Posts: 390
Nickname: alank
Registered: Sep, 2004

Alan Knowles is Freelance Developer, works on PHP extensions and PEAR.
Hello world in Gtk Javascript Posted: May 31, 2007 9:59 AM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Alan Knowles.
Original Post: Hello world in Gtk Javascript
Feed Title: Smoking toooo much PHP
Feed URL: http://www.akbkhome.com/blog.php/RSS.xml
Feed Description: More than just a blog :)
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Alan Knowles
Latest Posts From Smoking toooo much PHP

Advertisement
My last entry described how to create objects for dmdscript, I made a brief comment, that gtk javascript might be quite cool.. Well after a bit of hacking I got hello world to work. (well and a bit more..)


Gtk.init();

var w = new Gtk.Window(0);
w.setTitle("hello world");
w.showAll();
Gtk.main();

run with
/tmp/gtkjs hello.ds

I started with the GtkD bindings code generator, and extracted out the HTML parser code (it parses the HTML API docs). The based on the code from the last post, and some of the ideas from GtkD generated all the classes for dmdscript.

At present:
  • 317 Classes, Including Atk, Glib, Gobject, gthread, gdk, gdkpixbuf, glade gtk and pango
  • 2554 Methods should be working.
What's left to do..
  • Signals - I've got a prototype working for this, so It's mostly a matter of  writing the generation code.
  • Enums - They are in the D code, but no exported to the Javascript side.
  • Argument checking.. - Should be pretty trivial to add..
  • Return checking.. again pretty trivial..
  • Custom code for non-generated methods, Structs etc.
  • Tiding up the APILookup files. - - they are pretty similar to the GtkD code at present, and my generator just ignores alot of them.
  • Lots of code tidy ups.. (the class registration is a bit of a brute force hack)
If you want to try it out... (developers only.. dont expect to write applications with it yet.)

svn co http://www.akbkhome.com/svn/gtkDS
cd gtkDS/wrap
#download API Files (needs curl / tar etc.)
sh downloadFiles.sh
#compile it - needs dmd installed..
sh buildit.sh
cd ..
#build the bindings - requires compd from dsource.org/projects/dool
compd gdkds.compd
/tmp/gtkjs test/hello.ds

Now I just wonder what use it is ;)


Read: Hello world in Gtk Javascript

Topic: Kolab web client finished Previous Topic   Next Topic Topic: links for 2007-05-29

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use