diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2023-12-12 21:27:08 +0100 |
---|---|---|
committer | Rodrigo Arias Mallo <rodrigo.arias@bsc.es> | 2023-12-21 01:05:58 +0100 |
commit | 1da1260af72b20126176e2b8f73f7b7fd5952ce1 (patch) | |
tree | 0fcdb276d30814ce4075f7cc205e357b2b7c1be5 /test/dw/dw_simple_container.hh | |
parent | 78ad5bfe9644d1217f9d9ad0bf2fcdc388551113 (diff) |
Split tests into unit and dw (graphical)
Graphical tests for the dw (Dillo Widget) are moved to test/dw, while
unit tests are placed into test/unit.
All tests are compiled with "make check" but only the tests that can run
without intervention and without a graphic display are executed.
Diffstat (limited to 'test/dw/dw_simple_container.hh')
-rw-r--r-- | test/dw/dw_simple_container.hh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/test/dw/dw_simple_container.hh b/test/dw/dw_simple_container.hh new file mode 100644 index 00000000..bd40b41e --- /dev/null +++ b/test/dw/dw_simple_container.hh @@ -0,0 +1,57 @@ +#ifndef __DW_SIMPLE_CONTAINER_HH__ +#define __DW_SIMPLE_CONTAINER_HH__ + +#include "dw/core.hh" + +namespace dw { + +/** + * Simple widget used for testing concepts. + */ +class SimpleContainer: public core::Widget +{ +private: + class SimpleContainerIterator: public core::Iterator + { + private: + int index (); + + public: + SimpleContainerIterator (SimpleContainer *simpleContainer, + core::Content::Type mask, + bool atEnd); + + lout::object::Object *clone (); + int compareTo (lout::object::Comparable *other); + + bool next (); + bool prev (); + void highlight (int start, int end, core::HighlightLayer layer); + void unhighlight (int direction, core::HighlightLayer layer); + void getAllocation (int start, int end, core::Allocation *allocation); + }; + + Widget *child; + +protected: + void sizeRequestSimpl (core::Requisition *requisition); + void getExtremesSimpl (core::Extremes *extremes); + void sizeAllocateImpl (core::Allocation *allocation); + +public: + static int CLASS_ID; + + SimpleContainer (); + ~SimpleContainer (); + + void draw (core::View *view, core::Rectangle *area, + core::DrawingContext *context); + core::Iterator *iterator (core::Content::Type mask, bool atEnd); + void removeChild (Widget *child); + + void setChild (core::Widget *child); +}; + +} // namespace dw + +#endif // __DW_SIMPLE_CONTAINER_HH__ |