summaryrefslogtreecommitdiff
path: root/src/examples/eolian_cxx/colourable.eo
blob: a708217a39386543d3eaad092fcf4262af52d788 (plain) (blame)
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
class Colourable (Eo_Base)
{
    /*@ Colourable class. */
    legacy_prefix: legacy;
    constructors {
        constructor {
            /*@ Default constructor. */
        }
        rgb_composite_constructor {
            /*@ Composite RGB Constructor. */
            params {
                @in int r; /*@ The red component. */
                @in int g; /*@ The green component. */
                @in int b; /*@ The blue component. */
               };
        };
        rgb_24bits_constructor {
            /*@ RGB Constructor. */
            params {
                @in int rgb; /*@ 24-bit RGB Component. */
            };
        };
    };
    methods {
        print_colour { /*@ Print the RGB colour. */ };
        colour_mask {
            /*@ The masked RGB value. */
            return int;
            params {
                @in int mask; /*@ The colour mask to be applied to current RGB value. */
            };
        };
    };
    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. */
            };
        };
    };
    events {
        colour_changed(int);
    };
};