summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-15 15:06:40 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-15 15:06:40 -0500
commit827cba3a39a4afe688bfa848fc7dd7c5899b506f (patch)
treed2fdfc1f057a2fa358dc7f418129e4fedf3678cb /tests
parent0bb5952228cc19402d90e0adf8c88c7ae4ddfd60 (diff)
downloadgtk3-tqt-engine-827cba3a39a4afe688bfa848fc7dd7c5899b506f.tar.gz
gtk3-tqt-engine-827cba3a39a4afe688bfa848fc7dd7c5899b506f.zip
Add initial interface code skeleton for later development
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am15
-rw-r--r--tests/test-painter.cpp27
2 files changed, 41 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9bae1df..50880e2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,7 +2,8 @@ EXTRA_DIST = \
test-widgets.glade
noinst_PROGRAMS = \
- test-widgets
+ test-widgets \
+ test-painter
test_widgets_CFLAGS = \
-I$(top_srcdir) \
@@ -14,4 +15,16 @@ test_widgets_LDADD = \
test_widgets_LDFLAGS = \
$(TDEGTK_LDFLAGS)
+test_painter_SOURCES = test-painter.cpp
+
+test_painter_CXXFLAGS = \
+ -I$(top_srcdir) \
+ $(TDEGTK_CFLAGS)
+
+test_painter_LDADD = \
+ $(TDEGTK_LIBADD)
+
+test_painter_LDFLAGS = \
+ $(TDEGTK_LDFLAGS)
+
# FIXME(Cimi): Figure out what tests must be compiled and add them here.
diff --git a/tests/test-painter.cpp b/tests/test-painter.cpp
new file mode 100644
index 0000000..c8bb77b
--- /dev/null
+++ b/tests/test-painter.cpp
@@ -0,0 +1,27 @@
+#include <cairo.h>
+
+int
+main (int argc, char *argv[])
+{
+ cairo_surface_t *surface;
+ cairo_t *cr;
+
+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 120, 120);
+ cr = cairo_create (surface);
+ /* Examples are in 1.0 x 1.0 coordinate space */
+ cairo_scale (cr, 120, 120);
+
+ /* Drawing code goes here */
+ cairo_set_line_width (cr, 0.1);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_rectangle (cr, 0.25, 0.25, 0.5, 0.5);
+ cairo_stroke (cr);
+
+ /* Write output and clean up */
+ cairo_surface_write_to_png (surface, "stroke.png");
+ cairo_destroy (cr);
+ cairo_surface_destroy (surface);
+
+ return 0;
+}
+