RooJSolutions en RSS: RooJSolutions - /index.php 150 150 More on syntax checking vala - and a nice video 2015-05-20 00:00:00 <a href="">Article originally from rooJSolutions blog</a><br/> <div> As I wrote last week. I had added full syntax checking to the editor. So it runs a full compile check as you type.</div> <div>Here's a nice video of it working...</div> <div> <iframe width="420" height="315" src="" frameborder="0" allowfullscreen=""></iframe> </div> <div> <br> </div> <div> After the initial joy of adding this to code, I soon realized it had a fatal flaw, read on to find out more..</div> <div> <br> </div> Fetching Resources from github in the App Builder and fake web servers 2015-05-09 00:00:00 <a href="">Article originally from rooJSolutions blog</a><br/> <div>My final words this week on the builder - handling resources, and fake web servers</div><div><br></div><div>While I talked in the other posts about how the builder extracts the API for various components from the libvala library and the vapi files, some information that the builder requires has to be manually, created or fetched from other locations.</div><div><br></div><div>When the Builder was written in seed, it basically looked at the source code directory, and read files relative to the source code. For the Vala version however, it's not expected to know about the source code directory, so I had to use a different approach.</div><div><br></div> libvala testing code and extracting API from the vapis 2015-05-08 00:00:00 <a href="">Article originally from rooJSolutions blog</a><br/> <div>And the next part in the series. Gir and Vala structures, Nothing like a slow day to write a few blog posts.&nbsp;</div><div><br></div><div>The App Builder was originally designed to build applications using seed (the gobject introspection webkit javascript engines bindings), One of the key elements of how this was done involved introspecting the Gtk API, and extracting all the properties, signals and class structure.</div><div><br></div><div>In this post I will go through the history of how I extracted the API information on Gtk, initially from Gobject introspection and GIR files, upto the current version which uses libvala to get the correct API direct from the vapi files.</div><div><br></div><div><br></div> App Builder - Database based Plugin builders for Web components. 2015-05-07 00:00:00 <a href="">Article originally from rooJSolutions blog</a><br/> <div><div>It's been a busy month, unfortunately not for our paid work, which has dropped down to a trickle. Taking advantage of this I've been building more into our App Builder. This post hopefully is the first in a series about some of those additions.</div><div>The Primary purposes of our Builder is</div><div><ul><li>A WYSIWYG tool for web applications using both Bootstrap or the RooJS libraries.</li><li>A new visual way of building Gnome/Gtk Applications&nbsp;</li></ul></div><div>In working towards these goals the builder has moved forward in a few directions. the first one that this blog post talks about is generating User interfaces from Database Schemas.</div></div><div><br></div> Gtk3 introspection updates and Unusable Unity.. 2011-04-25 00:00:00 <a href="">Article originally from rooJSolutions blog</a><br/> <div><font size="2">Well, as Gnome 3 is out, it has to be tested.&nbsp;Luckily&nbsp;I've not got a huge deployment to sort out, but as I have a few applications that use Gtk, I thought it was about time I upgraded one of my machines to see what chaos I will have to deal with in the future.</font></div><div><font size="2"><br></font></div><div><font size="2">So it was one of my Ubuntu boxes that got the pleasure of a Natty and <a href="">Gnome3 PPA</a> upgrade. (I use debian on my other development box, which actually got destroyed last week with a complete disk failure, although I suspect the motherboard may have problems... It's getting old like me...)</font></div><div><font size="2"><br></font></div><div><font size="2">Upgrading to Natty is not to bad, from what I remember it only took a small amount of brain surgery to get it to boot correctly after the upgrade. But once up, you get the pleasure of the Unity desktop. My first impressions where not to hot on unity, my wife uses it on her netbook, it's great there, after the initial shock of me upgrading without her knowing, she actually said it was alot better than compiz. Although she missed the special effects.</font></div><div><font size="2"><br></font></div><div><font size="2">But after using Unity on the big screens, it just became unbearable. Detached menus may seem like a cool idea, and are quite handy on a netbook, but they are an absolute nightmare when using things like gimp on dual head full HD monitors, my wrists hurt after a few minutes....&nbsp;</font></div><div><font size="2"><br></font></div><div><font size="2">Along with the removal of the Applications/Places/System menu's which while klunky are still handy for quickly finding applications. A classic example of this Alleyoop Memory Checker, a very nice wrapper around valgrind. In the Unity world if you do not know the name of the application, then finding it is a huge mouse journey around big icons.&nbsp;</font></div><div><font size="2"><br></font></div><div><font size="2">As for the left icon menu, all I can say is that I'm not the worlds best designer (although at least I did study it), but it's so graphically noisy that it unusable. It's basically a bad re-invention of Docky/Cairo Dock, which do far better jobs at providing a similar task role.&nbsp;</font></div><div><font size="2"><br></font></div><div><font size="2">So after all that I did try and get gnome-shell going, but unfortunatly the Gnome3 PPA build is not currrently working, and also has a rather nasty habit removing all usable desktop enviroments. I ended up adding xterm to one of the /etc/Xorg/X.sessiond files and starting up gnome-panel, mutter and docky to produce a usable desktop for the time being, while I wait to test out the latest gnome-shell.</font></div><h3><font size="2">So on with the harder stuff.. - Gtk3 and introspection.</font></h3><div><font size="2">One of the key applications I use to develop is<a href=""> app.Builder.js</a> , it's a drag/drop interface to build web applications, that also allows you to fill in all the code and associate it clearly with the element and event occuring. It's written in Javascript, and uses Gnome seed to run on the desktop. As I've mentioned before Seed is a bridge layer between the Webkit Javascript engine, and Gobject-introspection, the now standard way to interface Gnome/Gtk/Glib etc. projects to non-C languages, eg. Python, Javascript (and others...)</font></div><div><font size="2"><br></font></div><div><font size="2">With the introduction of Gtk3, GObject introspection has also been updated, and the updated mix between the two had quite a few knock on effects to the builder I had written using Gtk2 and pre-0.9 versions of Gobject introspections. Heres a general summary of the changes.</font></div><h3><font size="2">TreeIter and TextIter&nbsp;</font></h3><div><font size="2">The latest version of GObject introspection has a feature called caller allocates, this basically means that previously with Seed we had to create an instance of a TreeIter, the the TreeIter call would be of type 'inout' (eg. the Iter would be sent into the method, and returned out)</font></div><div><font size="2"><br></font></div><div><font size="2">eg. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</font></div><pre><font size="2">var iter = new Gtk.TreeIter();<br></font><font size="2">model.get_iter_from_string(iter, path);<br></font><font size="2">// iter would now contain the tree iter for that path..</font></pre><div><font size="2"><br></font></div><div><font size="2">In newer versions, the iter is an 'out' value, which means you have to create an object for the iter to be added to. eg.</font></div><pre><font size="2">var iret = {};<br></font><font size="2">model.get_iter_from_string(iret, path);<br></font><font size="2">// iret.iter now contains the tree iter.</font></pre><div><font size="2"><br></font></div><h3><font size="2">TreeSelection&nbsp;</font></h3><div><font size="2">since the get_selected method for a GtkTreeSelection now has 2 out values, the call has change from</font></div><div><font size="2"><br></font></div><div><font size="2">OLD:</font></div><pre><font size="2">var iter = new Gtk.TreeIter();<br></font><font size="2">selection.get_selected(model, iter);</font></pre><div><font size="2"><br></font></div><div><font size="2">NEW</font></div><pre><font size="2">var sret = {};<br></font><font size="2">selection.get_selected(sret);<br></font><font size="2">// sret now contains { model: **THE MODEL**, iter: **THE ITER** }</font></pre><div><font size="2"><br></font></div><h3><font size="2">TreeModel get_value</font></h3><div><font size="2"><br></font></div><div><font size="2">Since get_value does not have a return value, seed with return the 'out' values as the return object.</font></div><div><font size="2"><br></font></div><div><font size="2">OLD:</font></div><pre><font size="2">var value = new GObject.Value('');<br></font><font size="2">model.get_value(iter, 2, value);<br></font><font size="2">print(value.value);</font></pre><div><font size="2"><br></font></div><div><font size="2">NEW</font></div><pre><font size="2">var str = model.get_value(iter, 2).value.get_string();<br></font><font size="2">print(str);</font></pre><div><font size="2"><br></font></div><h3><font size="2">Drag pixmap becomes surfaces</font></h3><div><span style="font-size: small; ">This is a pure Gtk3 API change (BC break)</span></div><div><font size="2"><br></font></div><div><font size="2">OLD:</font></div><pre><font size="2">var pix = widget.create_row_drag_icon ( path);<br></font><font size="2">Gtk.drag_set_icon_pixmap (ctx, pix.get_colormap(), &nbsp; pix, &nbsp;null, ..... )</font></pre><div><font size="2"><br></font></div><div><font size="2">NEW:</font></div><pre><font size="2">var pix = widget.create_row_drag_icon ( path);<br></font><font size="2">Gtk.drag_set_icon_surface(ctx, pix);</font></pre><h3><font size="2">Drag drop data passing..</font></h3><div><font size="2"><br></font></div><div><font size="2">The drag drop signals appear to work ok, however I've not managed to get the data to go back and forth,&nbsp;</font></div><div><font size="2">a quick workaround is to just use some form of global variable to store the current dragged item (I doubt you will get more than one dragged item at once..)</font></div><div><font size="2"><br></font></div><h3><font size="2">Drag drop API</font></h3><div><span style="font-size: small; ">alot of these appear to have played musical chairs.</span></div><pre><font size="2">GtkWidget.prototype.drag_source_set -&gt; Gtk.drag_source_set</font><font size="2"><br></font><font size="2">Gtk.drag_source_set_target_list -&gt; GtkWidget.prototype.drag_source_set_target_list<br></font><font size="2">Gtk.drag_dest_set -&gt; GtkWidget.prototype.drag_dest_set</font></pre><div><font size="2"><br></font></div><h3><font size="2">Internal Seed changes</font></h3><div><font size="2"><br></font></div><div><font size="2">I've added a few more fixes to Seed in the last few weeks, mostly to handle compiling correctly and detecting the correct version of introspection. for the most part it's working fine, however I'm still a bit baffled by a Glib memory corruption bug, which occured after multiple model.set_value and model.get_value calls. After running valgrind, I managed to stop the corruption occuring by increasing the allocated size for a struct by 1 byte&nbsp;</font></div><div><font size="2">Around line 546 and 640 of seed-engine.c the change goes something like this.</font></div><pre><font size="2">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out_args[n_out_args].v_pointer = g_malloc0 (size);<br></font><font size="2">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out_args[n_out_args].v_pointer = g_malloc0 (size+ 1);</font></pre><div><font size="2"><br></font></div><div><font size="2">Arround line 738 of seed-structs.c &nbsp;</font></div><pre><font size="2">- &nbsp;object = g_slice_alloc0 (size);<br></font><font size="2">+ &nbsp;object = g_slice_alloc0 (size +1);</font></pre><div><font size="2">&nbsp;</font></div><div><font size="2"><br></font></div><div><font size="2"><br></font></div><div style="font-size: 13px; "><br></div> GtkDjs, daily builds, added libraries and much more.. 2007-08-07 17:42:45 <a href="">Article originally from rooJSolutions blog</a><br/> gtkds - more updates and better debugging.. 2007-07-31 23:08:00 <a href="">Article originally from rooJSolutions blog</a><br/> Add one feature, and create a few bugs.. seems like it's always the way..<br /><br />The two features added over the weekend where class syntax support and include support. My initial effort proved to be a little off the mark. <br /><br />Read on if you want to know the nitty gritty details about writing an interperted language runtime... Along with a list of the Gtk binding improvements..<span style="font-weight: bold;"><br /></span><p /><br /> Compairing Adobe AIR to dmdscript / fastcgijs / gtkjs 2007-07-28 22:36:00 <a href="">Article originally from rooJSolutions blog</a><br/> A good friend of mine asked what's the difference between the dmdscript/fastcgijs/gtkjs stuff I'm doing and Adobe AIR.<br /><br />I've not really looked at Adobe AIR much, noticed that it was mentioned on the extjs site, so I thought I'd do a quick &quot;what's the difference&quot;..<br /><br />So what's the key differences<br /><br />For Adobe AIR<br /><ul><li>Backed by a huge company with unknown reasons for hooking you in.</li><li>Lot's of support for Adobe technology, but any other libraries, you can forget about.</li><li>Probably written in C++ or C, so there are probably a few nice security holes difficult to find in the memory allocation. Even if you did have access to the source - it would be a pretty complex task to write bindings for libraries.<br /></li><li>Great support for Windows, pretty good for Mac, and bugger all for other un*x's</li></ul>For GtkJs / Fastcgijs / dmdscript<br /><ul><li>Absolutly no support ;) - obviously only done, because it's interesting and fun!<br /></li><li>Lots of support for any open source library, as long as you are willing to waste a few days working out how mindblowingly simple it is to write bindings.</li><li>Written in D, which makes it pretty secure (well if you fix some of the bugs in my generator to do a small amount of sanity checks). And due to the fact that it's so similar in syntax to Javascript that makes the whole process of moving slow parts into compiled code considerable simpler than any other scripted language..</li><li>Great support for linux, and it might just work on any other platform, as long as you can find someone who knows those platforms.<br /></li></ul> Personally I think the Adobe AIR idea is pretty good, Javascript is a good basis for a language. But to be honest for the reasons above, I would not touch it with a barge pole..<br />