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(
'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)

View file

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

View file

@ -21,9 +21,9 @@
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_keyboard.h>
#include <math.h>
#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;

View file

@ -22,9 +22,9 @@
#include <wlr/types/wlr_cursor.h>
#include <wlr/util/log.h>
#include <wlr/types/wlr_list.h>
#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;

View file

@ -18,9 +18,9 @@
#include <wlr/types/wlr_keyboard.h>
#include <wlr/util/log.h>
#include <math.h>
#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;

View file

@ -11,7 +11,7 @@
#include <wlr/types/wlr_output.h>
#include <wlr/util/log.h>
#include <xkbcommon/xkbcommon.h>
#include "shared.h"
#include "support/shared.h"
struct sample_state {
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/util/log.h>
#include <math.h>
#include "shared.h"
#include "cat.h"
#include "support/shared.h"
#include "support/cat.h"
struct sample_state {
struct wlr_renderer *renderer;

View file

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