Menu

Tree [b751e5] master /
 History

HTTPS access


File Date Author Commit
 dml 2014-04-23 Newton Newton [a82f63] show/hide method have been added
 engine 2014-04-23 newton newton [f051e5] drwH/VSeparator have been merged to drwSeparator
 example 2014-05-03 Newton Kim Newton Kim [43a60a] Depends bugfix
 runner 2014-05-03 Newton Kim Newton Kim [34e0b6] Lintian errors have been fixed.(not completed)
 script 2014-04-23 newton newton [f051e5] drwH/VSeparator have been merged to drwSeparator
 toolbox 2014-05-04 Newton Kim Newton Kim [b6808e] changelog has been added
 utility 2014-04-18 newton newton [34fe50] script grammar has been changed
 LICENSE.md 2013-08-17 Newton Newton [8ac948] README guide has been added
 Makefile.in 2014-05-03 Newton Kim Newton Kim [34e0b6] Lintian errors have been fixed.(not completed)
 README.md 2014-04-23 Newton Newton [4fb1f3] Update README.md
 changelog 2014-05-04 Newton Kim Newton Kim [b6808e] changelog has been added
 config-Ubuntu-12.04.sh 2014-05-03 Newton Newton [a35b8d] Parallel building
 config-Ubuntu-14.04.sh 2014-05-03 Newton Newton [a35b8d] Parallel building
 config-Ubuntu-common.sh 2014-05-03 Newton Kim Newton Kim [34e0b6] Lintian errors have been fixed.(not completed)
 config.h.in 2013-08-17 Newton Newton [f03df5] Let the callback starts with _
 configure 2014-05-06 Newton Kim Newton Kim [b751e5] version up

Read Me

drew v0.2

Drew is an implementation of DML language specification.

DML is a lightweight UI description language.

Why drew?

Drew's basic idea is similar to QML.

However, drew has simpler grammar than QML, lighter than Javascript, and, much cheaper than QT.

QML is a combination of Javascript, QML language, and QT.

Drew is a combination of Lua script, DML language, and GTK.

How to install

./configure

make

sudo make install

If you want to create the debian package, do as follows

make deb

How to run

example/hello.drew

or

drew example/hello.drew

If you want to see the debug messages, do as follows

example/hello.drew -d

or

drew example/hello.drew -d

If you want to see the debug messages and verbose messages, do as follows

example/hello.drew -v

or

drew example/hello.drew -v

If you want to see the help screen, do as follows

drew -h

or

drew --help

DML

DML(Drew Meta Language) is a UI description language.

Basic Grammar

Following form is a description of DML in e-BNF.

INTEGER := [0-9]+

FLOATING := IEEE759 floating point

CODE := '{' [ . | \n ]* '}'

STRING := ".*"

SYMBOL := [._]*

BOOL := true | false

VALUE := BOOL | STRING | FLOATING | INTEGER

TUPLE := SYMBOL ':' VALUE

LIST := SYMBOL '[' VALUE* ']'

SCRIPT := SYMBOL '(' SYMBOL* ')' CODE

DICTIONARY := SYMBOL '{' [ TUPLE | LIST | DICTIONARY ]* '}'

UI Grammar

DML := meta_sentence gui_sentence

meta_sentence := version ':' FLOATING | profile ':' STRING

gui_sentence := '_on_init' window_sentence

window_sentence := window { window_content }

window_content := border : INTEGER | _on_destroy SCRIPT | _before_destroy SCRIPT | button_sentence

button_sentence := button { button_content }

button_content := label : STRING | _on_click SCRIPT

The hello world example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/local/bin/drew
version:0.1
profile:"dml"
window{
    border:10
    _before_destroy(){
        log.verbose("delete-devent occurred")
        return false
    }
    _on_destroy(){
        log.debug("quit")
        gui.quit()
    }
    button{
        label:"hello world"
        _on_click(){
            cout.print("hello world!")
        }
    }
}

UI elements

window

The window sentence represents the window widget in the graphic widget library.

border(property) : sets the thickness of the window.

_before_destroy : is called before the window is closed. if it returns true, the winodw will not close. Otherwise, it closes.

_on_destroy : is called when the window is closed.

button

The button sentence represents the button widget in the graphic widget library.

label : sets the caption of the button.

_on_click : is called when the button is clicked.

script extensions

gui

quit : quit the DML application

log

verbose : log verbose message on cerr. It works only when drew is executed with -v or --verbose argument

debug : log debug message on cerr. It works only when drew is executed with -d or --debug argument

cout

print : print the arguments to cout.

License

Drew is under MIT license.

Thanks to

Drew Scheneman, my first English teacher who taught me English in English