Feeds

Giving some Juce to cross-platform tools

Juce in the spotlight

The Power of One Brief: Top reasons to choose HP BladeSystem

More Juce in use

In addition to the source code for the core library, the demo program and a simple little "Hello World" project (designed to get you started), you also get complete source to the Juicer. This is a visual tool that enables you to lay out components on a form, establish basic size/position for each child component, set up callback routines, and so on. You can test the interface within Juicer and, once you're happy, it will spit out a C++ source file with corresponding header which can then be incorporated directly into your project. The same .CPP file can be loaded back into Juicer, provided that you retain the XML-based metadata which Juicer places within the source. This is done by enclosing the metadata inside a "#if 0" block, thereby preventing the compiler from attempting to compile it! This is obviously a lot less work than attempting to reparse the C++ code. Juicer isn't complete (for example, not every callback for every widget type is implemented), but it eliminates the need for a lot of tedious hand-coding of complex control layouts.

Before I wind up, I should also mention another cunning little innovation in the shape of Julian's freely downloadable BinaryBuilder utility. These days, applications typically need a lot of additional binary data such as image icons, sound files, and so on. The means of encoding this information into an executable is obviously platform-dependent (bundles under OS X, custom resources on Windows, etc) which isn't a great thing from a cross-platform perspective. The BinaryBuilder utility neatly gets around this by scanning a designated directory and encoding every encountered file into an unsigned character array, each of which ends up as a field inside the target class. For example, the demo program has a directory called binarydata containing a ZIP file, a PNG file, a WAV, and some other stuff. These files all end up as arrays within the BinaryData.cpp file that's generated by BinaryBuilder.

You might think this is inefficient, but I did just mention ZIP files! Along with everything else, Juce has built-in ZIP file support. Decompressing a random SVG file from a ZIP stream created via BinaryBuilder is as easy as this:

MemoryInputStream iconsFileStream (BinaryData::icons_zip, BinaryData::icons_zipSize, false); 

ZipFile icons (&iconsFileStream, false); 

// Load a random SVG file from our embedded icons.zip file.

InputStream* svgFileStream = icons.createStreamForEntry 
(Random::getSystemRandom().nextInt(icons.getNumEntries()));

if (svgFileStream != 0)
{
  Drawable* loadedSVG = Drawable::createFromImageDataStream (*svgFileStream);
  // etc...

Summary

So is Julian operating a charity here? Well, no. If you use Juce to create GPL'd open-source applications, then you pay nothing. However, if you want to create commercial applications, you'll need to pay £399+VAT for a commercial license. This entitles you to use Juce in just one product. Additional licenses cost another £399 per product, or, more sensibly, you can pay an additional £300 to upgrade to a full commercial license for the creation of an unlimited number of commercial products. This obviously compares very favourably with Qt: where a three-platform (Windows, Mac, Linux) commercial license will cost you $6600 or over £3,300.

Bottom line? I'm very impressed with Juce. Not only is it reasonably priced, full-featured, and very well thought out, but it also produces tight executables making it ideally suited not only for larger projects but small shareware utilities. Even the supplied source code is a joy to browse as Julian has used a consistent, intuitive naming style for all his classes and methods. You can download a compiled HTML (CHM) file of reference documentation from the Juce website, or browse online here.

And in Figure 3, here's Juicer running on Mac OS X with a screenshot of our "Fearless Leader" (see support forum!) How do you know it's running on the Mac? The subtle give away is the caption bar – the close/maximise/minimise buttons have moved over to the left: compare with other screenshots. ®

Shows Juicer running on Mac OS X.

Seven Steps to Software Security

More from The Register

next story
KDE releases ice-cream coloured Plasma 5 just in time for summer
Melty but refreshing - popular rival to Mint's Cinnamon's still a work in progress
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Secure microkernel that uses maths to be 'bug free' goes open source
Hacker-repelling, drone-protecting code will soon be yours to tweak as you see fit
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Another day, another Firefox: Version 31 is upon us ALREADY
Web devs, Mozilla really wants you to like this one
Google shows off new Chrome OS look
Athena springs full-grown from Chromium project's head
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
Application security programs and practises
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Securing Web Applications Made Simple and Scalable
Learn how automated security testing can provide a simple and scalable way to protect your web applications.