summaryrefslogtreecommitdiff
path: root/project/templates
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-06-25 11:20:10 +1000
committerJed Barber <jjbarber@y7mail.com>2017-06-25 11:20:10 +1000
commit425785e6fc15bba19cf97a84030bc046e71cbc35 (patch)
treee9ad22d98e791e8518b55881657dd3b8a0673c95 /project/templates
parent15af05257bc029f446faa8e8087ae670625ae1a9 (diff)
Added article for FLTK Ada binding
Diffstat (limited to 'project/templates')
-rw-r--r--project/templates/fltkada.html68
-rw-r--r--project/templates/index.html3
2 files changed, 71 insertions, 0 deletions
diff --git a/project/templates/fltkada.html b/project/templates/fltkada.html
new file mode 100644
index 0000000..584e4f8
--- /dev/null
+++ b/project/templates/fltkada.html
@@ -0,0 +1,68 @@
+
+{% extends "base.html" %}
+
+
+
+{% block title %}FLTK Ada{% endblock %}
+
+
+
+{% block content %}
+
+<h4>FLTK Ada Binding</h4>
+
+<p>Estimated status: 40-45% complete</p>
+
+
+<h5>25/6/2017</h5>
+
+<p>FLTK, or by its full name the <a href="http://www.fltk.org/" target="_blank">Fast Light Toolkit</a>,
+is a graphical widget toolkit noteworthy for being so lightweight that it is commonly statically linked.
+Projects that make use of it include the <a href="http://www.dillo.org/" target="_blank">Dillo</a> web
+browser, the <a href="http://flwm.sourceforge.net/" target="_blank">FLWM</a> X window manager, and the
+<a href="http://www.equinox-project.org/" target="_blank">Equinox Desktop Environment</a>. There are
+bindings for it in several languages, including Python, Perl and Ruby, but not Ada. Until now!</p>
+
+<p>This is a spinoff from Adapad, and so despite not yet being complete it can be at least guaranteed to
+be enough to write a text editor. It's a thick, loosely coupled binding, accomplished by first exporting
+the interface to C, then importing that to Ada. Attempted usage of the internal C interface as a binding
+on its own is not supported.</p>
+
+<p>A typical FLTK Hello World program in Ada:
+<code>
+ with
+ FLTK.Widgets.Groups.Windows,
+ FLTK.Widgets.Boxes;
+
+ function Hello_World return Integer is
+
+ My_Win : FLTK.Widgets.Groups.Windows.Window :=
+ FLTK.Widgets.Groups.Windows.Create (100, 100, 200, 200, "Untitled");
+
+ My_Box : FLTK.Widgets.Boxes.Box :=
+ FLTK.Widgets.Boxes.Create (50, 50, 100, 100, "Hello, World!");
+
+ begin
+
+ My_Win.Add (My_Box);
+ My_Win.Show;
+
+ return FLTK.Run;
+
+ end Hello_World;
+</code>
+</p>
+
+<p>Aside from reworking the types to better fit the strongly typed philosophy of Ada, the entire library has
+been structured to avoid explicit heap usage. As you can see from the above example, the intended use is to
+declare FLTK objects on the stack. Allocation and deallocation of the C++ internals is handled automatically.</p>
+
+<p>A few other minor changes were involved, such as requiring widgets to be explicitly added to a group rather
+than implicitly being added to the last group not yet ended. At the moment the package specifications should
+provide sufficient information to allow programmers to work with the library.</p>
+
+<p>Git repo is <a href="/cgit/cgit.cgi/fltkada.git/" target="_blank">here</a>.</p>
+
+{% endblock %}
+
+
diff --git a/project/templates/index.html b/project/templates/index.html
index 5c7af6a..fd97587 100644
--- a/project/templates/index.html
+++ b/project/templates/index.html
@@ -16,6 +16,9 @@
{% block content %}
<ul class="index">
+ <li><a href="/fltkada.html">FLTK Ada Binding</a><br>
+ <span class="post">(Posted 25/6/2017)</span></li>
+
<li><a href="/stvcount.html">Single Transferable Vote Counter</a><br>
<span class="post">(Posted 19/2/2017)</span></li>