summaryrefslogtreecommitdiff
path: root/src/examples/eolian_cxx/colourable.eo
blob: e0b011b1e48f0a632db069a5c634ee3a3cd54a43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class Colourable (Eo.Base)
{
    /*@ Colourable class. */
    legacy_prefix: legacy;
    data: Colourable_Data;
    methods {
        rgb_composite_constructor {
            /*@ Composite RGB Constructor. */
            legacy: null;
            params {
                @in int r; /*@ The red component. */
                @in int g; /*@ The green component. */
                @in int b; /*@ The blue component. */
               }
        }
        rgb_24bits_constructor {
            /*@ RGB Constructor. */
            legacy: null;
            params {
                @in int rgb; /*@ 24-bit RGB Component. */
            }
        }
        print_colour { /*@ Print the RGB colour. */ }
        colour_mask {
            /*@ The masked RGB value. */
            params {
                @in int mask; /*@ The colour mask to be applied to current RGB value. */
            }
            return: int; /*@ The RGB colour. */
        }
    }
    properties {
        colour {
            set {
                /*@ Sets a 24-bit RGB colour. */
            }
            get {
                /*@ Gets the 24-bit RGB colour. */
            }
            values {
                int rgb; /*@ The RGB colour value. */
            }
        }
        composite_colour {
            set {
                /*@ Sets a composite RGB colour. */
            }
            get {
                /*@ Gets the composite RGB colour. */
            }
            values {
                int r; /*@ The red component. */
                int g; /*@ The green component. */
                int b; /*@ The blue component. */
            }
        }
    }
    implements {
        Eo.Base.constructor;
        Eo.Base.destructor;
    }
    constructors {
        .rgb_composite_constructor;
        .rgb_24bits_constructor;
    }
    events {
        colour_changed: int;
    }
}