diff options
author | Eitan Isaacson <eitan@monotonous.org> | 2011-05-31 12:09:24 -0700 |
---|---|---|
committer | Eitan Isaacson <eitan@monotonous.org> | 2011-06-01 12:47:01 -0700 |
commit | 6ce0faf5d814a8b791427ac20aaa8b87a46c77eb (patch) | |
tree | 131f127ccd4635f052f257d4b4677ea68a835b00 /libcaribou/key-model.vala | |
parent | 22ed36c74597159cf4866abee35bb898127dea5a (diff) | |
download | caribou-6ce0faf5d814a8b791427ac20aaa8b87a46c77eb.tar.gz |
Added IKeyboardObject interface, and have all model classes implement it.
Diffstat (limited to 'libcaribou/key-model.vala')
-rw-r--r-- | libcaribou/key-model.vala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libcaribou/key-model.vala b/libcaribou/key-model.vala index 49e88aa..e7edb8c 100644 --- a/libcaribou/key-model.vala +++ b/libcaribou/key-model.vala @@ -1,7 +1,7 @@ using GLib; namespace Caribou { - public class KeyModel : GLib.Object, IScannableItem { + public class KeyModel : GLib.Object, IScannableItem, IKeyboardObject { public double margin_left { get; set; default = 0.0; } public double width { get; set; default = 1.0; } public string toggle { get; set; default = ""; } @@ -84,5 +84,16 @@ namespace Caribou { public KeyModel[] get_extended_keys () { return (KeyModel[]) extended_keys.to_array (); } + + public KeyModel[] get_keys () { + Gee.ArrayList<KeyModel> all_keys = new Gee.ArrayList<KeyModel> (); + all_keys.add (this); + all_keys.add_all (extended_keys); + return (KeyModel[]) all_keys.to_array (); + } + + public IKeyboardObject[] get_children () { + return (IKeyboardObject[]) extended_keys.to_array (); + } } }
\ No newline at end of file |