summaryrefslogtreecommitdiff
path: root/libcaribou/keyboard-model.vala
diff options
context:
space:
mode:
authorEitan Isaacson <eitan@monotonous.org>2011-05-31 12:09:24 -0700
committerEitan Isaacson <eitan@monotonous.org>2011-06-01 12:47:01 -0700
commit6ce0faf5d814a8b791427ac20aaa8b87a46c77eb (patch)
tree131f127ccd4635f052f257d4b4677ea68a835b00 /libcaribou/keyboard-model.vala
parent22ed36c74597159cf4866abee35bb898127dea5a (diff)
downloadcaribou-6ce0faf5d814a8b791427ac20aaa8b87a46c77eb.tar.gz
Added IKeyboardObject interface, and have all model classes implement it.
Diffstat (limited to 'libcaribou/keyboard-model.vala')
-rw-r--r--libcaribou/keyboard-model.vala12
1 files changed, 11 insertions, 1 deletions
diff --git a/libcaribou/keyboard-model.vala b/libcaribou/keyboard-model.vala
index 3b06c9f..64813f2 100644
--- a/libcaribou/keyboard-model.vala
+++ b/libcaribou/keyboard-model.vala
@@ -1,7 +1,7 @@
using Bus;
namespace Caribou {
- public class KeyboardModel : Object {
+ public class KeyboardModel : Object, IKeyboardObject {
public string active_group { get; private set; default = ""; }
public string keyboard_type { get; construct; }
@@ -54,5 +54,15 @@ namespace Caribou {
}
}
+ public IKeyboardObject[] get_children () {
+ IKeyboardObject[] children = new IKeyboardObject[groups.size ()];
+ uint i = 0;
+
+ foreach (GroupModel obj in groups.get_values ()) {
+ children[i++] = (IKeyboardObject) obj;
+ }
+
+ return children;
+ }
}
} \ No newline at end of file