diff options
author | Sebastian Geerken <devnull@localhost> | 2014-05-06 20:23:53 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-05-06 20:23:53 +0200 |
commit | 5e8dec509c8402a8f761e3156bd22278c332c5fc (patch) | |
tree | 41a62bd0d660b93a5758a9b36cbfb6e6046f741d /lout/object.cc | |
parent | e0d27594996a9aca98ae1c25b64f14ff2dfeb1de (diff) |
New signal "resizeQueued" for Layout. It is used by ComplexButtonResource, instead of "canvasSizeChange"; this seems to fix a CPU hogging problem.
Diffstat (limited to 'lout/object.cc')
-rw-r--r-- | lout/object.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lout/object.cc b/lout/object.cc index 74328d22..e4e0152a 100644 --- a/lout/object.cc +++ b/lout/object.cc @@ -211,6 +211,32 @@ int Integer::compareTo(Comparable *other) return value - ((Integer*)other)->value; } +// ------------- +// Boolean +// ------------- + +bool Boolean::equals(Object *other) +{ + bool value2 = ((Boolean*)other)->value; + // TODO Does "==" work? + return (value && value2) || (!value && value2); +} + +int Boolean::hashValue() +{ + return value ? 1 : 0; +} + +void Boolean::intoStringBuffer(misc::StringBuffer *sb) +{ + sb->append(value ? "true" : "false"); +} + +int Boolean::compareTo(Comparable *other) +{ + return (value ? 1 : 0) - (((Boolean*)other)->value ? 1 : 0); +} + // ----------------- // ConstString // ----------------- |