From 4f73498b78645728ff23adfbf9b650a1b66b66bb Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 1 Nov 2017 15:47:58 -0400 Subject: [PATCH] Move shared example code --- examples/meson.build | 3 ++- examples/multi-pointer.c | 6 +++--- examples/output-layout.c | 6 +++--- examples/pointer.c | 6 +++--- examples/rotation.c | 6 +++--- examples/simple.c | 2 +- examples/support/README | 2 ++ examples/{ => support}/cat.c | 0 examples/{ => support}/cat.h | 0 examples/{ => support}/config.c | 0 examples/{ => support}/config.h | 0 examples/{ => support}/ini.c | 0 examples/{ => support}/ini.h | 0 examples/{ => support}/shared.c | 0 examples/{ => support}/shared.h | 0 examples/tablet.c | 4 ++-- examples/touch.c | 4 ++-- 17 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 examples/support/README rename examples/{ => support}/cat.c (100%) rename examples/{ => support}/cat.h (100%) rename examples/{ => support}/config.c (100%) rename examples/{ => support}/config.h (100%) rename examples/{ => support}/ini.c (100%) rename examples/{ => support}/ini.h (100%) rename examples/{ => support}/shared.c (100%) rename examples/{ => support}/shared.h (100%) diff --git a/examples/meson.build b/examples/meson.build index 3402441b..89fc6211 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,7 +1,8 @@ lib_shared = static_library( 'shared', - ['shared.c', 'cat.c', 'ini.c', 'config.c'], + ['support/shared.c', 'support/cat.c', 'support/ini.c', 'support/config.c'], dependencies: wlroots, + include_directories: include_directories('support') ) executable('simple', 'simple.c', dependencies: wlroots, link_with: lib_shared) diff --git a/examples/multi-pointer.c b/examples/multi-pointer.c index e0993987..e29a69db 100644 --- a/examples/multi-pointer.c +++ b/examples/multi-pointer.c @@ -22,9 +22,9 @@ #include #include #include -#include "shared.h" -#include "config.h" -#include "cat.h" +#include "support/shared.h" +#include "support/config.h" +#include "support/cat.h" struct sample_state; diff --git a/examples/output-layout.c b/examples/output-layout.c index 771ccd77..084bd7df 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -21,9 +21,9 @@ #include #include #include -#include "shared.h" -#include "config.h" -#include "cat.h" +#include "support/shared.h" +#include "support/config.h" +#include "support/cat.h" struct sample_state { struct example_config *config; diff --git a/examples/pointer.c b/examples/pointer.c index 8927314e..1bcd7349 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -22,9 +22,9 @@ #include #include #include -#include "shared.h" -#include "config.h" -#include "cat.h" +#include "support/shared.h" +#include "support/config.h" +#include "support/cat.h" struct sample_state { struct compositor_state *compositor; diff --git a/examples/rotation.c b/examples/rotation.c index d7892723..276b6255 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -18,9 +18,9 @@ #include #include #include -#include "shared.h" -#include "config.h" -#include "cat.h" +#include "support/shared.h" +#include "support/config.h" +#include "support/cat.h" struct sample_state { struct example_config *config; diff --git a/examples/simple.c b/examples/simple.c index ba1ac289..ad1b0792 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -11,7 +11,7 @@ #include #include #include -#include "shared.h" +#include "support/shared.h" struct sample_state { float color[3]; diff --git a/examples/support/README b/examples/support/README new file mode 100644 index 00000000..c32c873e --- /dev/null +++ b/examples/support/README @@ -0,0 +1,2 @@ +Support code for the examples. Code that's not relevant to the principle each +example demonstrates is largely offloaded to this directory. diff --git a/examples/cat.c b/examples/support/cat.c similarity index 100% rename from examples/cat.c rename to examples/support/cat.c diff --git a/examples/cat.h b/examples/support/cat.h similarity index 100% rename from examples/cat.h rename to examples/support/cat.h diff --git a/examples/config.c b/examples/support/config.c similarity index 100% rename from examples/config.c rename to examples/support/config.c diff --git a/examples/config.h b/examples/support/config.h similarity index 100% rename from examples/config.h rename to examples/support/config.h diff --git a/examples/ini.c b/examples/support/ini.c similarity index 100% rename from examples/ini.c rename to examples/support/ini.c diff --git a/examples/ini.h b/examples/support/ini.h similarity index 100% rename from examples/ini.h rename to examples/support/ini.h diff --git a/examples/shared.c b/examples/support/shared.c similarity index 100% rename from examples/shared.c rename to examples/support/shared.c diff --git a/examples/shared.h b/examples/support/shared.h similarity index 100% rename from examples/shared.h rename to examples/support/shared.h diff --git a/examples/tablet.c b/examples/tablet.c index 4b565d3d..4eaa204a 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -19,8 +19,8 @@ #include #include #include -#include "shared.h" -#include "cat.h" +#include "support/shared.h" +#include "support/cat.h" struct sample_state { struct wlr_renderer *renderer; diff --git a/examples/touch.c b/examples/touch.c index 3f0c4867..df6c6c48 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -18,8 +18,8 @@ #include #include #include -#include "shared.h" -#include "cat.h" +#include "support/shared.h" +#include "support/cat.h" struct sample_state { struct wlr_renderer *renderer;