Move shared example code

This commit is contained in:
Drew DeVault 2017-11-01 15:47:58 -04:00
parent 19f24e5530
commit 4f73498b78
17 changed files with 21 additions and 18 deletions

View File

@ -1,7 +1,8 @@
lib_shared = static_library( lib_shared = static_library(
'shared', 'shared',
['shared.c', 'cat.c', 'ini.c', 'config.c'], ['support/shared.c', 'support/cat.c', 'support/ini.c', 'support/config.c'],
dependencies: wlroots, dependencies: wlroots,
include_directories: include_directories('support')
) )
executable('simple', 'simple.c', dependencies: wlroots, link_with: lib_shared) executable('simple', 'simple.c', dependencies: wlroots, link_with: lib_shared)

View File

@ -22,9 +22,9 @@
#include <wlr/types/wlr_cursor.h> #include <wlr/types/wlr_cursor.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <wlr/types/wlr_list.h> #include <wlr/types/wlr_list.h>
#include "shared.h" #include "support/shared.h"
#include "config.h" #include "support/config.h"
#include "cat.h" #include "support/cat.h"
struct sample_state; struct sample_state;

View File

@ -21,9 +21,9 @@
#include <wlr/types/wlr_output.h> #include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_keyboard.h> #include <wlr/types/wlr_keyboard.h>
#include <math.h> #include <math.h>
#include "shared.h" #include "support/shared.h"
#include "config.h" #include "support/config.h"
#include "cat.h" #include "support/cat.h"
struct sample_state { struct sample_state {
struct example_config *config; struct example_config *config;

View File

@ -22,9 +22,9 @@
#include <wlr/types/wlr_cursor.h> #include <wlr/types/wlr_cursor.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <wlr/types/wlr_list.h> #include <wlr/types/wlr_list.h>
#include "shared.h" #include "support/shared.h"
#include "config.h" #include "support/config.h"
#include "cat.h" #include "support/cat.h"
struct sample_state { struct sample_state {
struct compositor_state *compositor; struct compositor_state *compositor;

View File

@ -18,9 +18,9 @@
#include <wlr/types/wlr_keyboard.h> #include <wlr/types/wlr_keyboard.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <math.h> #include <math.h>
#include "shared.h" #include "support/shared.h"
#include "config.h" #include "support/config.h"
#include "cat.h" #include "support/cat.h"
struct sample_state { struct sample_state {
struct example_config *config; struct example_config *config;

View File

@ -11,7 +11,7 @@
#include <wlr/types/wlr_output.h> #include <wlr/types/wlr_output.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <xkbcommon/xkbcommon.h> #include <xkbcommon/xkbcommon.h>
#include "shared.h" #include "support/shared.h"
struct sample_state { struct sample_state {
float color[3]; float color[3];

2
examples/support/README Normal file
View File

@ -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.

View File

@ -19,8 +19,8 @@
#include <wlr/types/wlr_tablet_pad.h> #include <wlr/types/wlr_tablet_pad.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <math.h> #include <math.h>
#include "shared.h" #include "support/shared.h"
#include "cat.h" #include "support/cat.h"
struct sample_state { struct sample_state {
struct wlr_renderer *renderer; struct wlr_renderer *renderer;

View File

@ -18,8 +18,8 @@
#include <wlr/backend/session.h> #include <wlr/backend/session.h>
#include <wlr/types/wlr_list.h> #include <wlr/types/wlr_list.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include "shared.h" #include "support/shared.h"
#include "cat.h" #include "support/cat.h"
struct sample_state { struct sample_state {
struct wlr_renderer *renderer; struct wlr_renderer *renderer;