// Vala Sample File

<beginfold id='1'>/*</beginfold id='1'>
 * Multiline comment
 * NOTE FIXME ALERT
 <endfold id='1'>*/</endfold id='1'>
void main() <beginfold id='2'>{</beginfold id='2'>
    print("Hello World\n");
<endfold id='2'>}</endfold id='2'>

// Example 1
class Sample: Object <beginfold id='2'>{</beginfold id='2'>
    void greeting() <beginfold id='2'>{</beginfold id='2'>
        stdout.printf("Hello World\n");
    <endfold id='2'>}</endfold id='2'>

    static void main(string[] args) <beginfold id='2'>{</beginfold id='2'>
        var sample = new Sample();
        sample.greeting();
    <endfold id='2'>}</endfold id='2'>
<endfold id='2'>}</endfold id='2'>

// Example 2
using GLib;

interface Printable <beginfold id='2'>{</beginfold id='2'>
    public abstract string print();

    public virtual string pretty_print() <beginfold id='2'>{</beginfold id='2'>
        return "Please " + print();
    <endfold id='2'>}</endfold id='2'>
<endfold id='2'>}</endfold id='2'>

class NormalPrint: Object, Printable <beginfold id='2'>{</beginfold id='2'>
    string print() <beginfold id='2'>{</beginfold id='2'>
        return "don't forget about me";
    <endfold id='2'>}</endfold id='2'>
<endfold id='2'>}</endfold id='2'>

class OverridePrint: Object, Printable <beginfold id='2'>{</beginfold id='2'>
    string print() <beginfold id='2'>{</beginfold id='2'>
        return "Mind the gap";
    <endfold id='2'>}</endfold id='2'>

    public override string pretty_print() <beginfold id='2'>{</beginfold id='2'>
        return "Override";
    <endfold id='2'>}</endfold id='2'>
<endfold id='2'>}</endfold id='2'>

void main(string[] args) <beginfold id='2'>{</beginfold id='2'>
    var normal = new NormalPrint();
    var overridden = new OverridePrint();

    print(normal.pretty_print());
    print(overridden.pretty_print());
<endfold id='2'>}</endfold id='2'>

// Example 3
using Gtk;

int main(string[] args) <beginfold id='2'>{</beginfold id='2'>
    Gtk.init(ref args);

    var window = new Window();
    window.title = "Hello, World!";
    window.border_width = 10;
    window.window_position = WindowPosition.CENTER;
    window.set_default_size(350, 70);
    window.destroy.connect(Gtk.main_quit);

    var label = new Label("Hello, World!");

    window.add(label);
    window.show_all();

    Gtk.main();
    return 0;
<endfold id='2'>}</endfold id='2'>
