projects
/
app.Builder.js
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests/enum.vala
[app.Builder.js]
/
tests
/
enum.vala
diff --git
a/tests/enum.vala
b/tests/enum.vala
index
7a7a9ed
..
2d41de7
100644
(file)
--- a/
tests/enum.vala
+++ b/
tests/enum.vala
@@
-1,15
+1,30
@@
// compile
// compile
-// valac --pkg gtk+-3.0 enum.vala -o /tmp/enum
+// valac --pkg gtk+-3.0 enum.vala
--pkg libvala-0.26
-o /tmp/enum
// ??--pkg javascriptcore \
int main (string[] args) {
// ??--pkg javascriptcore \
int main (string[] args) {
+
+ var max = (int)Vala.TokenType.YIELD +1;
+ for (var i =0; i < max;i++) {
+ var m = (Vala.TokenType)i;
+ var s = m.to_string();
+ if (s[0] == '`') {
+ print("%s\n",s.slice(1,-1));
+ }
+ }
+
+
Gtk.init(ref args);
var type = typeof(Gtk.Box);
var ocl = (ObjectClass) type.class_ref ();
var ps = ocl.find_property("orientation");
var vt = ps.value_type;
Gtk.init(ref args);
var type = typeof(Gtk.Box);
var ocl = (ObjectClass) type.class_ref ();
var ps = ocl.find_property("orientation");
var vt = ps.value_type;
- print("%s : %s\n", vt.name(), vt.is_enum() ? "Y" : "N");
+ EnumClass ec = (EnumClass) vt.class_ref ();
+ for (var i =0;i< ec.n_values; i++) {
+ var ev = ec.values[i];
+ print("%s : %d\n", ev.value_name,ev.value);
+ }
return 0;
}
return 0;
}