summaryrefslogtreecommitdiff
path: root/src/examples/eolian_cxx/ns_colourable.eo
blob: 90abc65ae8b4a931740f058d0857641106187a22 (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
class Ns.Colourable (Eo.Base)
{
    [[Colourable class.]]
    legacy_prefix: legacy;
    data: Colourable_Data;
    methods {
        rgb_24bits_constructor {
            [[RGB Constructor.]]
            legacy: null;
            params {
                @in rgb: int; [[24-bit RGB Component.]]
            }
        }
        print_colour { [[Print the RGB colour.]] }
        colour_mask {
            [[The masked RGB value.]]
            params {
                @in mask: int; [[The colour mask to be applied to current RGB value.]]
            }
            return: int; [[The RGB colour.]]
        }
        @property colour {
            set {
                [[Sets a 24-bit RGB colour.]]
            }
            get {
                [[Gets the 24-bit RGB colour.]]
            }
            values {
                rgb: int; [[The RGB colour value.]]
            }
        }
        @property composite_colour {
            set {
                [[Sets a composite RGB colour.]]
            }
            get {
                [[Gets the composite RGB colour.]]
            }
            values {
                r: int; [[The red component.]]
                g: int; [[The green component.]]
                b: int; [[The blue component.]]
            }
        }
    }
    implements {
        Eo.Base.constructor;
        Eo.Base.destructor;
    }
    constructors {
        .rgb_24bits_constructor;
    }
    events {
        colour_changed: int;
    }
}