markupreader: Add get_attributes() method returning a copy of attributes.
[vala-lang.git] / tests / objects / interfaces.vala
blobe6895d68be0f7adb698bdbb093bc12060cf017cf
1 using GLib;
3 interface Maman.Ibaz : Object {
4 public abstract void do_action ();
6 public abstract void do_virtual_action ();
8 protected void protected_mixin_1() {
9 stdout.puts("protected_mixin_1\n");
10 protected_mixin_2();
13 protected void protected_mixin_2() {
14 stdout.puts("protected_mixin_2\n");
17 public void public_mixin() {
18 protected_mixin_1();
19 protected_mixin_2();
24 class Maman.Baz : Object, Ibaz {
25 public void do_action () {
26 stdout.printf (" 2");
29 public virtual void do_virtual_action () {
30 stdout.printf (" 4");
33 public void do_mixin() {
34 public_mixin();
38 class Maman.SubBaz : Baz {
39 public override void do_virtual_action () {
40 stdout.printf (" 6");
43 public static int main_func () {
44 stdout.printf ("Interface Test: 1");
46 Ibaz ibaz = new Baz ();
47 ibaz.do_action ();
48 ibaz.public_mixin();
49 (ibaz as Baz).do_mixin();
51 stdout.printf (" 3");
53 ibaz.do_virtual_action ();
55 stdout.printf (" 5");
57 Ibaz subbaz = new SubBaz ();
58 subbaz.do_virtual_action ();
60 stdout.printf (" 7\n");
62 subbaz.public_mixin();
63 (subbaz as Baz).public_mixin();
65 return 0;
69 void main () {
70 Maman.SubBaz.main_func ();