aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-11-15 00:18:43 -0800
committerChad Versace <chad.versace@linux.intel.com>2012-11-15 00:54:52 -0800
commit6cf39526db7b028aa201c4cf62bd2253764e20bf (patch)
treefb7b6455db7a74e8093ffd829a578a54055fd073
parentd06ea26fe6ed38fb2eade64487052a29a39b36a8 (diff)
include: Fold nearly all headers into waffle.h
Fold all headers into waffle.h except - The native platform headers, because users need to be able to select which to include and exclude. - waffle_version.h, which is generate at configure time. When Waffle's documentation consisted of Doxygen in the headers, it was sensible to maintain a separate header for each class of functions. The Doxygen was lengthy, thus having separate headers made the documentation easier to navigate. Now that the documentation resides in manpage xml, each individual header is nearly empty. It's silly to have numerous headers that declare only 3 to 4 functions each. Strictly speaking, removing header files breaks the API. But I'm aware of no client that will miss the removed headers. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--doc/code-style.txt8
-rw-r--r--include/CMakeLists.txt11
-rw-r--r--include/waffle/waffle.h319
-rw-r--r--include/waffle/waffle_attrib_list.h61
-rw-r--r--include/waffle/waffle_config.h63
-rw-r--r--include/waffle/waffle_context.h64
-rw-r--r--include/waffle/waffle_display.h67
-rw-r--r--include/waffle/waffle_dl.h45
-rw-r--r--include/waffle/waffle_enum.h104
-rw-r--r--include/waffle/waffle_error.h69
-rw-r--r--include/waffle/waffle_gl_misc.h57
-rw-r--r--include/waffle/waffle_init.h42
-rw-r--r--include/waffle/waffle_portability.h64
-rw-r--r--include/waffle/waffle_window.h72
-rw-r--r--src/waffle/api/api_object.h2
-rw-r--r--src/waffle/api/api_priv.h2
-rw-r--r--src/waffle/api/waffle_attrib_list.c2
-rw-r--r--src/waffle/api/waffle_attrib_list_unittest.c2
-rw-r--r--src/waffle/api/waffle_config.c4
-rw-r--r--src/waffle/api/waffle_context.c4
-rw-r--r--src/waffle/api/waffle_display.c5
-rw-r--r--src/waffle/api/waffle_dl.c3
-rw-r--r--src/waffle/api/waffle_enum.c2
-rw-r--r--src/waffle/api/waffle_gl_misc.c3
-rw-r--r--src/waffle/api/waffle_init.c3
-rw-r--r--src/waffle/api/waffle_window.c2
-rw-r--r--src/waffle/cgl/cgl_config.m2
-rw-r--r--src/waffle/cgl/cgl_context.m2
-rw-r--r--src/waffle/cgl/cgl_display.m2
-rw-r--r--src/waffle/cgl/cgl_dl.m2
-rw-r--r--src/waffle/core/wcore_config.h2
-rw-r--r--src/waffle/core/wcore_config_attrs.c3
-rw-r--r--src/waffle/core/wcore_config_attrs_unittest.c2
-rw-r--r--src/waffle/core/wcore_context.h2
-rw-r--r--src/waffle/core/wcore_display.h6
-rw-r--r--src/waffle/core/wcore_error.h2
-rw-r--r--src/waffle/core/wcore_window.h5
-rw-r--r--src/waffle/egl/wegl_config.c2
-rw-r--r--src/waffle/egl/wegl_context.c2
-rw-r--r--src/waffle/egl/wegl_display.c3
-rw-r--r--src/waffle/glx/glx_config.c2
-rw-r--r--src/waffle/glx/glx_context.c2
-rw-r--r--src/waffle/glx/glx_display.c3
-rw-r--r--src/waffle/linux/linux_dl.c2
-rw-r--r--src/waffle/linux/linux_platform.c2
45 files changed, 317 insertions, 811 deletions
diff --git a/doc/code-style.txt b/doc/code-style.txt
index 2d12598..1445c75 100644
--- a/doc/code-style.txt
+++ b/doc/code-style.txt
@@ -29,14 +29,14 @@ Much of Waffle's code adheres to an object oriented design. Not only does this
influence Waffle's architectural design, but also its naming conventions and code
organization.
-For this discussion, we will use `struct waffle_window` as an example. It is
+For this discussion, we will use `struct wegl_window` as an example. It is
implemented in the files
- /include/waffle/waffle_window.h
- /src/waffle/api/waffle_window.c
+ wegl_window.h
+ wegl_window.c
A class's header and source file have the same name as the class. For example,
-waffle_window.h and waffle_window.c.
+wegl_window.h and wegl_window.c.
Method names follow the convention of `typename_operation`. This makes it
immediately obvious on what the function acts and in which file the function
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 9107628..eb1136d 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -3,20 +3,9 @@ configure_file(waffle/waffle_version.h.in
@ONLY)
install(FILES waffle/waffle.h
- waffle/waffle_attrib_list.h
- waffle/waffle_config.h
- waffle/waffle_context.h
- waffle/waffle_display.h
- waffle/waffle_dl.h
- waffle/waffle_enum.h
- waffle/waffle_error.h
- waffle/waffle_gl_misc.h
waffle/waffle_gbm.h
waffle/waffle_glx.h
- waffle/waffle_init.h
- waffle/waffle_portability.h
waffle/waffle_version.h
waffle/waffle_wayland.h
- waffle/waffle_window.h
waffle/waffle_x11_egl.h
DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${waffle_libname})
diff --git a/include/waffle/waffle.h b/include/waffle/waffle.h
index c086799..b4ac742 100644
--- a/include/waffle/waffle.h
+++ b/include/waffle/waffle.h
@@ -25,16 +25,313 @@
#pragma once
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+
#include "waffle_version.h"
-#include "waffle_attrib_list.h"
-#include "waffle_config.h"
-#include "waffle_context.h"
-#include "waffle_display.h"
-#include "waffle_dl.h"
-#include "waffle_enum.h"
-#include "waffle_error.h"
-#include "waffle_gl_misc.h"
-#include "waffle_init.h"
-#include "waffle_portability.h"
-#include "waffle_window.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// WAFFLE_API - Declare that a symbol is in Waffle's public API.
+//
+// See "GCC Wiki - Visibility". (http://gcc.gnu.org/wiki/Visibility).
+// See "How to Write Shared Libraries. Ulrich Drepper.
+// (http://www.akkadia.org/drepper/dsohowto.pdf).
+//
+// TODO: Implement WAFFLE_API for Apple.
+//
+#if defined(__GNUC__) && __GNUC__ >= 4
+# define WAFFLE_API __attribute__ ((visibility("default")))
+#else
+# define WAFFLE_API
+#endif
+
+struct waffle_display;
+struct waffle_config;
+struct waffle_context;
+struct waffle_window;
+
+union waffle_native_display;
+union waffle_native_config;
+union waffle_native_context;
+union waffle_native_window;
+
+// ---------------------------------------------------------------------------
+// waffle_error
+// ---------------------------------------------------------------------------
+
+enum waffle_error {
+ WAFFLE_NO_ERROR = 0x00,
+ WAFFLE_ERROR_FATAL = 0x01,
+ WAFFLE_ERROR_UNKNOWN = 0x02,
+ WAFFLE_ERROR_INTERNAL = 0x03,
+ WAFFLE_ERROR_BAD_ALLOC = 0x04,
+ WAFFLE_ERROR_NOT_INITIALIZED = 0x05,
+ WAFFLE_ERROR_ALREADY_INITIALIZED = 0x06,
+ WAFFLE_ERROR_BAD_ATTRIBUTE = 0x08,
+ WAFFLE_ERROR_BAD_PARAMETER = 0x10,
+ WAFFLE_ERROR_BAD_DISPLAY_MATCH = 0x11,
+ WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM = 0x12,
+ WAFFLE_ERROR_BUILT_WITHOUT_SUPPORT = 0x13,
+};
+
+struct waffle_error_info {
+ int32_t code;
+ const char *message;
+ size_t message_length;
+};
+
+WAFFLE_API int32_t
+waffle_error_get_code(void);
+
+WAFFLE_API const struct waffle_error_info*
+waffle_error_get_info(void);
+
+WAFFLE_API const char*
+waffle_error_to_string(int32_t e);
+
+// ---------------------------------------------------------------------------
+// waffle_enum
+// ---------------------------------------------------------------------------
+
+enum waffle_enum {
+ // ------------------------------------------------------------------
+ // Generic
+ // ------------------------------------------------------------------
+
+ WAFFLE_DONT_CARE = -1,
+ WAFFLE_NONE = 0,
+
+ // ------------------------------------------------------------------
+ // For waffle_init()
+ // ------------------------------------------------------------------
+
+ WAFFLE_PLATFORM = 0x0010,
+ WAFFLE_PLATFORM_ANDROID = 0x0011,
+ WAFFLE_PLATFORM_CGL = 0x0012,
+ WAFFLE_PLATFORM_GLX = 0x0013,
+ WAFFLE_PLATFORM_WAYLAND = 0x0014,
+ WAFFLE_PLATFORM_X11_EGL = 0x0015,
+ WAFFLE_PLATFORM_GBM = 0x0016,
+
+ // ------------------------------------------------------------------
+ // For waffle_config_choose()
+ // ------------------------------------------------------------------
+
+ WAFFLE_CONTEXT_API = 0x020a,
+ WAFFLE_CONTEXT_OPENGL = 0x020b,
+ WAFFLE_CONTEXT_OPENGL_ES1 = 0x020c,
+ WAFFLE_CONTEXT_OPENGL_ES2 = 0x020d,
+ WAFFLE_CONTEXT_OPENGL_ES3 = 0x0214,
+
+ WAFFLE_CONTEXT_MAJOR_VERSION = 0x020e,
+ WAFFLE_CONTEXT_MINOR_VERSION = 0x020f,
+
+ WAFFLE_CONTEXT_PROFILE = 0x0210,
+ WAFFLE_CONTEXT_CORE_PROFILE = 0x0211,
+ WAFFLE_CONTEXT_COMPATIBILITY_PROFILE = 0x0212,
+
+ WAFFLE_RED_SIZE = 0x0201,
+ WAFFLE_GREEN_SIZE = 0x0202,
+ WAFFLE_BLUE_SIZE = 0x0203,
+ WAFFLE_ALPHA_SIZE = 0x0204,
+
+ WAFFLE_DEPTH_SIZE = 0x0205,
+ WAFFLE_STENCIL_SIZE = 0x0206,
+
+ WAFFLE_SAMPLE_BUFFERS = 0x0207,
+ WAFFLE_SAMPLES = 0x0208,
+
+ WAFFLE_DOUBLE_BUFFERED = 0x0209,
+
+ WAFFLE_ACCUM_BUFFER = 0x0213,
+
+ // ------------------------------------------------------------------
+ // For waffle_dl_sym()
+ // ------------------------------------------------------------------
+
+ WAFFLE_DL_OPENGL = 0x0301,
+ WAFFLE_DL_OPENGL_ES1 = 0x0302,
+ WAFFLE_DL_OPENGL_ES2 = 0x0303,
+ WAFFLE_DL_OPENGL_ES3 = 0x0304,
+};
+
+WAFFLE_API const char*
+waffle_enum_to_string(int32_t e);
+
+// ---------------------------------------------------------------------------
+
+WAFFLE_API bool
+waffle_init(const int32_t *attrib_list);
+
+WAFFLE_API bool
+waffle_make_current(struct waffle_display *dpy,
+ struct waffle_window *window,
+ struct waffle_context *ctx);
+
+WAFFLE_API void*
+waffle_get_proc_address(const char *name);
+
+WAFFLE_API bool
+waffle_is_extension_in_string(const char *restrict extension_string,
+ const char *restrict extension_name);
+
+// ---------------------------------------------------------------------------
+// waffle_display
+// ---------------------------------------------------------------------------
+
+WAFFLE_API struct waffle_display*
+waffle_display_connect(const char *name);
+
+WAFFLE_API bool
+waffle_display_disconnect(struct waffle_display *self);
+
+WAFFLE_API bool
+waffle_display_supports_context_api(struct waffle_display *self,
+ int32_t context_api);
+
+WAFFLE_API union waffle_native_display*
+waffle_display_get_native(struct waffle_display *self);
+
+// ---------------------------------------------------------------------------
+// waffle_config
+// ---------------------------------------------------------------------------
+
+WAFFLE_API struct waffle_config*
+waffle_config_choose(struct waffle_display *dpy,
+ const int32_t attrib_list[]);
+
+WAFFLE_API bool
+waffle_config_destroy(struct waffle_config *self);
+
+WAFFLE_API union waffle_native_config*
+waffle_config_get_native(struct waffle_config *self);
+
+// ---------------------------------------------------------------------------
+// waffle_context
+// ---------------------------------------------------------------------------
+
+WAFFLE_API struct waffle_context*
+waffle_context_create(struct waffle_config *config,
+ struct waffle_context *shared_ctx);
+
+WAFFLE_API bool
+waffle_context_destroy(struct waffle_context *self);
+
+WAFFLE_API union waffle_native_context*
+waffle_context_get_native(struct waffle_context *self);
+
+// ---------------------------------------------------------------------------
+// waffle_window
+// ---------------------------------------------------------------------------
+
+WAFFLE_API struct waffle_window*
+waffle_window_create(
+ struct waffle_config *config,
+ int32_t width,
+ int32_t height);
+
+WAFFLE_API bool
+waffle_window_destroy(struct waffle_window *self);
+
+WAFFLE_API bool
+waffle_window_show(struct waffle_window *self);
+
+WAFFLE_API bool
+waffle_window_swap_buffers(struct waffle_window *self);
+
+WAFFLE_API union waffle_native_window*
+waffle_window_get_native(struct waffle_window *self);
+
+// ---------------------------------------------------------------------------
+// waffle_dl
+// ---------------------------------------------------------------------------
+
+WAFFLE_API bool
+waffle_dl_can_open(int32_t dl);
+
+WAFFLE_API void*
+waffle_dl_sym(int32_t dl, const char *name);
+
+// ---------------------------------------------------------------------------
+// waffle_native
+// ---------------------------------------------------------------------------
+
+struct waffle_gbm_config;
+struct waffle_gbm_context;
+struct waffle_gbm_display;
+struct waffle_gbm_window;
+struct waffle_glx_config;
+struct waffle_glx_context;
+struct waffle_glx_display;
+struct waffle_glx_window;
+struct waffle_wayland_config;
+struct waffle_wayland_context;
+struct waffle_wayland_display;
+struct waffle_wayland_window;
+struct waffle_x11_egl_config;
+struct waffle_x11_egl_context;
+struct waffle_x11_egl_display;
+struct waffle_x11_egl_window;
+
+union waffle_native_display {
+ struct waffle_gbm_display *gbm;
+ struct waffle_glx_display *glx;
+ struct waffle_x11_egl_display *x11_egl;
+ struct waffle_wayland_display *wayland;
+};
+
+union waffle_native_config {
+ struct waffle_gbm_config *gbm;
+ struct waffle_glx_config *glx;
+ struct waffle_x11_egl_config *x11_egl;
+ struct waffle_wayland_config *wayland;
+};
+
+union waffle_native_context {
+ struct waffle_gbm_context *gbm;
+ struct waffle_glx_context *glx;
+ struct waffle_x11_egl_context *x11_egl;
+ struct waffle_wayland_context *wayland;
+};
+
+union waffle_native_window {
+ struct waffle_gbm_window *gbm;
+ struct waffle_glx_window *glx;
+ struct waffle_x11_egl_window *x11_egl;
+ struct waffle_wayland_window *wayland;
+};
+
+// ---------------------------------------------------------------------------
+// waffle_attrib_list
+// ---------------------------------------------------------------------------
+
+WAFFLE_API int32_t
+waffle_attrib_list_length(const int32_t attrib_list[]);
+
+WAFFLE_API bool
+waffle_attrib_list_get(
+ const int32_t attrib_list[],
+ int32_t key,
+ int32_t *value);
+
+WAFFLE_API bool
+waffle_attrib_list_get_with_default(
+ const int32_t attrib_list[],
+ int32_t key,
+ int32_t *value,
+ int32_t default_value);
+
+WAFFLE_API bool
+waffle_attrib_list_update(
+ int32_t *attrib_list,
+ int32_t key,
+ int32_t value);
+
+#ifdef __cplusplus
+} // end extern "C"
+#endif
diff --git a/include/waffle/waffle_attrib_list.h b/include/waffle/waffle_attrib_list.h
deleted file mode 100644
index c7f059d..0000000
--- a/include/waffle/waffle_attrib_list.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WAFFLE_API int32_t
-waffle_attrib_list_length(const int32_t attrib_list[]);
-
-WAFFLE_API bool
-waffle_attrib_list_get(
- const int32_t attrib_list[],
- int32_t key,
- int32_t *value);
-
-WAFFLE_API bool
-waffle_attrib_list_get_with_default(
- const int32_t attrib_list[],
- int32_t key,
- int32_t *value,
- int32_t default_value);
-
-WAFFLE_API bool
-waffle_attrib_list_update(
- int32_t *attrib_list,
- int32_t key,
- int32_t value);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_config.h b/include/waffle/waffle_config.h
deleted file mode 100644
index 6f352a2..0000000
--- a/include/waffle/waffle_config.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct waffle_config;
-struct waffle_display;
-
-struct waffle_gbm_config;
-struct waffle_glx_config;
-struct waffle_x11_egl_config;
-struct waffle_wayland_config;
-
-union waffle_native_config {
- struct waffle_gbm_config *gbm;
- struct waffle_glx_config *glx;
- struct waffle_x11_egl_config *x11_egl;
- struct waffle_wayland_config *wayland;
-};
-
-WAFFLE_API struct waffle_config*
-waffle_config_choose(struct waffle_display *dpy, const int32_t attrib_list[]);
-
-WAFFLE_API bool
-waffle_config_destroy(struct waffle_config *self);
-
-WAFFLE_API union waffle_native_config*
-waffle_config_get_native(struct waffle_config *self);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_context.h b/include/waffle/waffle_context.h
deleted file mode 100644
index f89da00..0000000
--- a/include/waffle/waffle_context.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdbool.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct waffle_config;
-struct waffle_context;
-
-struct waffle_gbm_context;
-struct waffle_glx_context;
-struct waffle_x11_egl_context;
-struct waffle_wayland_context;
-
-union waffle_native_context {
- struct waffle_gbm_context *gbm;
- struct waffle_glx_context *glx;
- struct waffle_x11_egl_context *x11_egl;
- struct waffle_wayland_context *wayland;
-};
-
-WAFFLE_API struct waffle_context*
-waffle_context_create(
- struct waffle_config *config,
- struct waffle_context *shared_ctx);
-
-WAFFLE_API bool
-waffle_context_destroy(struct waffle_context *self);
-
-WAFFLE_API union waffle_native_context*
-waffle_context_get_native(struct waffle_context *self);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_display.h b/include/waffle/waffle_display.h
deleted file mode 100644
index 27e5771..0000000
--- a/include/waffle/waffle_display.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct waffle_display;
-
-struct waffle_gbm_display;
-struct waffle_glx_display;
-struct waffle_x11_egl_display;
-struct waffle_wayland_display;
-
-union waffle_native_display {
- struct waffle_gbm_display *gbm;
- struct waffle_glx_display *glx;
- struct waffle_x11_egl_display *x11_egl;
- struct waffle_wayland_display *wayland;
-};
-
-WAFFLE_API struct waffle_display*
-waffle_display_connect(const char *name);
-
-WAFFLE_API bool
-waffle_display_disconnect(struct waffle_display *self);
-
-WAFFLE_API bool
-waffle_display_supports_context_api(
- struct waffle_display *self,
- int32_t context_api);
-
-WAFFLE_API union waffle_native_display*
-waffle_display_get_native(struct waffle_display *self);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_dl.h b/include/waffle/waffle_dl.h
deleted file mode 100644
index ae7a368..0000000
--- a/include/waffle/waffle_dl.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WAFFLE_API bool
-waffle_dl_can_open(int32_t dl);
-
-WAFFLE_API void*
-waffle_dl_sym(int32_t dl, const char *name);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_enum.h b/include/waffle/waffle_enum.h
deleted file mode 100644
index 6a4c796..0000000
--- a/include/waffle/waffle_enum.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WAFFLE_API const char*
-waffle_enum_to_string(int32_t e);
-
-enum waffle_enum {
- // ------------------------------------------------------------------
- // Generic
- // ------------------------------------------------------------------
-
- WAFFLE_DONT_CARE = -1,
- WAFFLE_NONE = 0,
-
- // ------------------------------------------------------------------
- // For waffle_init()
- // ------------------------------------------------------------------
-
- WAFFLE_PLATFORM = 0x0010,
- WAFFLE_PLATFORM_ANDROID = 0x0011,
- WAFFLE_PLATFORM_CGL = 0x0012,
- WAFFLE_PLATFORM_GLX = 0x0013,
- WAFFLE_PLATFORM_WAYLAND = 0x0014,
- WAFFLE_PLATFORM_X11_EGL = 0x0015,
- WAFFLE_PLATFORM_GBM = 0x0016,
-
- // ------------------------------------------------------------------
- // For waffle_config_choose()
- // ------------------------------------------------------------------
-
- WAFFLE_CONTEXT_API = 0x020a,
- WAFFLE_CONTEXT_OPENGL = 0x020b,
- WAFFLE_CONTEXT_OPENGL_ES1 = 0x020c,
- WAFFLE_CONTEXT_OPENGL_ES2 = 0x020d,
- WAFFLE_CONTEXT_OPENGL_ES3 = 0x0214,
-
- WAFFLE_CONTEXT_MAJOR_VERSION = 0x020e,
- WAFFLE_CONTEXT_MINOR_VERSION = 0x020f,
-
- WAFFLE_CONTEXT_PROFILE = 0x0210,
- WAFFLE_CONTEXT_CORE_PROFILE = 0x0211,
- WAFFLE_CONTEXT_COMPATIBILITY_PROFILE = 0x0212,
-
- WAFFLE_RED_SIZE = 0x0201,
- WAFFLE_GREEN_SIZE = 0x0202,
- WAFFLE_BLUE_SIZE = 0x0203,
- WAFFLE_ALPHA_SIZE = 0x0204,
-
- WAFFLE_DEPTH_SIZE = 0x0205,
- WAFFLE_STENCIL_SIZE = 0x0206,
-
- WAFFLE_SAMPLE_BUFFERS = 0x0207,
- WAFFLE_SAMPLES = 0x0208,
-
- WAFFLE_DOUBLE_BUFFERED = 0x0209,
-
- WAFFLE_ACCUM_BUFFER = 0x0213,
-
- // ------------------------------------------------------------------
- // For waffle_dl_sym()
- // ------------------------------------------------------------------
-
- WAFFLE_DL_OPENGL = 0x0301,
- WAFFLE_DL_OPENGL_ES1 = 0x0302,
- WAFFLE_DL_OPENGL_ES2 = 0x0303,
- WAFFLE_DL_OPENGL_ES3 = 0x0304,
-};
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_error.h b/include/waffle/waffle_error.h
deleted file mode 100644
index af9497c..0000000
--- a/include/waffle/waffle_error.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdint.h>
-#include <stddef.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct waffle_error_info {
- int32_t code;
- const char *message;
- size_t message_length;
-};
-
-WAFFLE_API int32_t
-waffle_error_get_code(void);
-
-WAFFLE_API const struct waffle_error_info*
-waffle_error_get_info(void);
-
-WAFFLE_API const char*
-waffle_error_to_string(int32_t e);
-
-enum waffle_error {
- WAFFLE_NO_ERROR = 0x00,
- WAFFLE_ERROR_FATAL = 0x01,
- WAFFLE_ERROR_UNKNOWN = 0x02,
- WAFFLE_ERROR_INTERNAL = 0x03,
- WAFFLE_ERROR_BAD_ALLOC = 0x04,
- WAFFLE_ERROR_NOT_INITIALIZED = 0x05,
- WAFFLE_ERROR_ALREADY_INITIALIZED = 0x06,
- WAFFLE_ERROR_BAD_ATTRIBUTE = 0x08,
- WAFFLE_ERROR_BAD_PARAMETER = 0x10,
- WAFFLE_ERROR_BAD_DISPLAY_MATCH = 0x11,
- WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM = 0x12,
- WAFFLE_ERROR_BUILT_WITHOUT_SUPPORT = 0x13,
-};
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_gl_misc.h b/include/waffle/waffle_gl_misc.h
deleted file mode 100644
index 71139f2..0000000
--- a/include/waffle/waffle_gl_misc.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct waffle_context;
-struct waffle_display;
-struct waffle_window;
-
-WAFFLE_API bool
-waffle_is_extension_in_string(
- const char *restrict extension_string,
- const char *restrict extension_name);
-
-WAFFLE_API bool
-waffle_make_current(
- struct waffle_display *dpy,
- struct waffle_window *window,
- struct waffle_context *ctx);
-
-WAFFLE_API void*
-waffle_get_proc_address(const char *name);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_init.h b/include/waffle/waffle_init.h
deleted file mode 100644
index 7a71635..0000000
--- a/include/waffle/waffle_init.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WAFFLE_API bool
-waffle_init(const int32_t *attrib_list);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/include/waffle/waffle_portability.h b/include/waffle/waffle_portability.h
deleted file mode 100644
index f72144f..0000000
--- a/include/waffle/waffle_portability.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-/// @defgroup waffle_portability waffle_portability
-/// @ingroup waffle_api
-///
-/// @brief Cross-platform portability.
-///
-/// Visual Studio doesn't support C99. Ugh.
-/// @{
-
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/// @def WAFFLE_API
-/// @brief Declare that a symbol is in Waffle's public API.
-////
-/// @see "GCC Wiki - Visibility". (http://gcc.gnu.org/wiki/Visibility).
-/// @see "How to Write Shared Libraries. Ulrich Drepper.
-/// (http://www.akkadia.org/drepper/dsohowto.pdf).
-///
-/// @todo Implement WAFFLE_API for Apple.
-/// @todo Implement WAFFLE_API for Windows.
-///
-#if defined(__GNUC__) && __GNUC__ >= 4
-# define WAFFLE_API __attribute__ ((visibility("default")))
-#else
-# define WAFFLE_API
-#endif
-
-#if __STDC_VERSION__ < 199901L
-# define restrict
-#endif
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
-
-/// @}
diff --git a/include/waffle/waffle_window.h b/include/waffle/waffle_window.h
deleted file mode 100644
index 9f43df4..0000000
--- a/include/waffle/waffle_window.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2012 Intel Corporation
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// - Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// - Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#pragma once
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "waffle_portability.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct waffle_config;
-struct waffle_window;
-
-struct waffle_gbm_window;
-struct waffle_glx_window;
-struct waffle_x11_egl_window;
-struct waffle_wayland_window;
-
-union waffle_native_window {
- struct waffle_gbm_window *gbm;
- struct waffle_glx_window *glx;
- struct waffle_x11_egl_window *x11_egl;
- struct waffle_wayland_window *wayland;
-};
-
-WAFFLE_API struct waffle_window*
-waffle_window_create(
- struct waffle_config *config,
- int32_t width,
- int32_t height);
-
-WAFFLE_API bool
-waffle_window_destroy(struct waffle_window *self);
-
-WAFFLE_API bool
-waffle_window_show(struct waffle_window *self);
-
-WAFFLE_API bool
-waffle_window_swap_buffers(struct waffle_window *self);
-
-WAFFLE_API union waffle_native_window*
-waffle_window_get_native(struct waffle_window *self);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
diff --git a/src/waffle/api/api_object.h b/src/waffle/api/api_object.h
index f3a67a5..d417d0a 100644
--- a/src/waffle/api/api_object.h
+++ b/src/waffle/api/api_object.h
@@ -25,7 +25,7 @@
#pragma once
-#include <stddef.h>
+#include "waffle.h"
// This header is so sad and lonely... but there is no other appropriate place
// to define this struct.
diff --git a/src/waffle/api/api_priv.h b/src/waffle/api/api_priv.h
index 8a886c7..0d76388 100644
--- a/src/waffle/api/api_priv.h
+++ b/src/waffle/api/api_priv.h
@@ -36,6 +36,8 @@
#include <stdbool.h>
#include <stddef.h>
+#include "waffle.h"
+
struct api_object;
struct wcore_platform;
diff --git a/src/waffle/api/waffle_attrib_list.c b/src/waffle/api/waffle_attrib_list.c
index b1cf6fd..523cac6 100644
--- a/src/waffle/api/waffle_attrib_list.c
+++ b/src/waffle/api/waffle_attrib_list.c
@@ -29,8 +29,6 @@
/// @file
/// @ingroup api
-#include "waffle_attrib_list.h"
-
#include "wcore_error.h"
int32_t
diff --git a/src/waffle/api/waffle_attrib_list_unittest.c b/src/waffle/api/waffle_attrib_list_unittest.c
index 8f4654b..8d0ff05 100644
--- a/src/waffle/api/waffle_attrib_list_unittest.c
+++ b/src/waffle/api/waffle_attrib_list_unittest.c
@@ -25,7 +25,7 @@
#include <string.h>
-#include "waffle_attrib_list.h"
+#include "waffle.h"
#include "waffle_test/waffle_test.h"
diff --git a/src/waffle/api/waffle_config.c b/src/waffle/api/waffle_config.c
index d05c96d..c8c8166 100644
--- a/src/waffle/api/waffle_config.c
+++ b/src/waffle/api/waffle_config.c
@@ -28,10 +28,6 @@
/// @file
-#include <stdlib.h>
-
-#include "waffle_config.h"
-
#include "api_priv.h"
#include "wcore_config_attrs.h"
diff --git a/src/waffle/api/waffle_context.c b/src/waffle/api/waffle_context.c
index 71e9c84..c2a898f 100644
--- a/src/waffle/api/waffle_context.c
+++ b/src/waffle/api/waffle_context.c
@@ -28,10 +28,6 @@
/// @file
-#include <stdlib.h>
-
-#include "waffle_context.h"
-
#include "api_priv.h"
#include "wcore_context.h"
diff --git a/src/waffle/api/waffle_display.c b/src/waffle/api/waffle_display.c
index 2ced67a..bdc04a9 100644
--- a/src/waffle/api/waffle_display.c
+++ b/src/waffle/api/waffle_display.c
@@ -28,11 +28,6 @@
/// @file
-#include <stdlib.h>
-
-#include "waffle_display.h"
-#include "waffle_enum.h"
-
#include "api_priv.h"
#include "wcore_error.h"
diff --git a/src/waffle/api/waffle_dl.c b/src/waffle/api/waffle_dl.c
index 9af3fad..3f80236 100644
--- a/src/waffle/api/waffle_dl.c
+++ b/src/waffle/api/waffle_dl.c
@@ -28,9 +28,6 @@
/// @file
-#include "waffle_dl.h"
-#include "waffle_enum.h"
-
#include "api_priv.h"
#include "wcore_error.h"
diff --git a/src/waffle/api/waffle_enum.c b/src/waffle/api/waffle_enum.c
index fbbe0c9..196bddf 100644
--- a/src/waffle/api/waffle_enum.c
+++ b/src/waffle/api/waffle_enum.c
@@ -28,8 +28,6 @@
/// @file
-#include "waffle_enum.h"
-
#include "wcore_error.h"
const char*
diff --git a/src/waffle/api/waffle_gl_misc.c b/src/waffle/api/waffle_gl_misc.c
index 0c5e3f2..f96d3bb 100644
--- a/src/waffle/api/waffle_gl_misc.c
+++ b/src/waffle/api/waffle_gl_misc.c
@@ -31,9 +31,6 @@
#include <stddef.h>
#include <string.h>
-#include "waffle_enum.h"
-#include "waffle_gl_misc.h"
-
#include "api_priv.h"
#include "wcore_context.h"
diff --git a/src/waffle/api/waffle_init.c b/src/waffle/api/waffle_init.c
index 334b835..5b17147 100644
--- a/src/waffle/api/waffle_init.c
+++ b/src/waffle/api/waffle_init.c
@@ -28,9 +28,6 @@
/// @file
-#include "waffle_enum.h"
-#include "waffle_init.h"
-
#include "api_priv.h"
#include "wcore_error.h"
diff --git a/src/waffle/api/waffle_window.c b/src/waffle/api/waffle_window.c
index 21f0409..85f29a2 100644
--- a/src/waffle/api/waffle_window.c
+++ b/src/waffle/api/waffle_window.c
@@ -30,8 +30,6 @@
#include <stdlib.h>
-#include "waffle_window.h"
-
#include "api_priv.h"
#include "wcore_config.h"
diff --git a/src/waffle/cgl/cgl_config.m b/src/waffle/cgl/cgl_config.m
index abe47ec..48713bd 100644
--- a/src/waffle/cgl/cgl_config.m
+++ b/src/waffle/cgl/cgl_config.m
@@ -27,8 +27,6 @@
#include <stdlib.h>
#include <string.h>
-#include "waffle_enum.h"
-
#include "wcore_config_attrs.h"
#include "wcore_error.h"
diff --git a/src/waffle/cgl/cgl_context.m b/src/waffle/cgl/cgl_context.m
index d77c78b..37c5148 100644
--- a/src/waffle/cgl/cgl_context.m
+++ b/src/waffle/cgl/cgl_context.m
@@ -26,8 +26,6 @@
#include <assert.h>
#include <stdlib.h>
-#include "waffle_enum.h"
-
#include "wcore_error.h"
#include "cgl_config.h"
diff --git a/src/waffle/cgl/cgl_display.m b/src/waffle/cgl/cgl_display.m
index 4bc4b1a..bafbb28 100644
--- a/src/waffle/cgl/cgl_display.m
+++ b/src/waffle/cgl/cgl_display.m
@@ -26,8 +26,6 @@
#include <stdlib.h>
-#include "waffle_enum.h"
-
#include "wcore_error.h"
#include "cgl_display.h"
diff --git a/src/waffle/cgl/cgl_dl.m b/src/waffle/cgl/cgl_dl.m
index 72558b3..8050efe 100644
--- a/src/waffle/cgl/cgl_dl.m
+++ b/src/waffle/cgl/cgl_dl.m
@@ -26,8 +26,6 @@
#include <assert.h>
#include <dlfcn.h>
-#include "waffle_enum.h"
-
#include "wcore_error.h"
#include "cgl_dl.h"
diff --git a/src/waffle/core/wcore_config.h b/src/waffle/core/wcore_config.h
index e5b811e..9c3597e 100644
--- a/src/waffle/core/wcore_config.h
+++ b/src/waffle/core/wcore_config.h
@@ -30,8 +30,6 @@
#include <stdlib.h>
#include <string.h>
-#include "waffle_config.h"
-
#include "api_object.h"
#include "wcore_display.h"
diff --git a/src/waffle/core/wcore_config_attrs.c b/src/waffle/core/wcore_config_attrs.c
index ddd28b3..1276e56 100644
--- a/src/waffle/core/wcore_config_attrs.c
+++ b/src/waffle/core/wcore_config_attrs.c
@@ -32,9 +32,6 @@
#include <stdlib.h>
#include <string.h>
-#include "waffle_attrib_list.h"
-#include "waffle_enum.h"
-
#include "wcore_config_attrs.h"
#include "wcore_error.h"
diff --git a/src/waffle/core/wcore_config_attrs_unittest.c b/src/waffle/core/wcore_config_attrs_unittest.c
index 5464f66..24a6c1c 100644
--- a/src/waffle/core/wcore_config_attrs_unittest.c
+++ b/src/waffle/core/wcore_config_attrs_unittest.c
@@ -26,8 +26,6 @@
#include <stdlib.h>
#include <string.h>
-#include "waffle_enum.h"
-
#include "waffle_test/waffle_test.h"
#include "wcore_config_attrs.h"
diff --git a/src/waffle/core/wcore_context.h b/src/waffle/core/wcore_context.h
index caf0e44..4e612e8 100644
--- a/src/waffle/core/wcore_context.h
+++ b/src/waffle/core/wcore_context.h
@@ -29,8 +29,6 @@
#include <stdbool.h>
#include <stdlib.h>
-#include "waffle_context.h"
-
#include "api_object.h"
#include "wcore_config.h"
diff --git a/src/waffle/core/wcore_display.h b/src/waffle/core/wcore_display.h
index d5b114e..f67bf03 100644
--- a/src/waffle/core/wcore_display.h
+++ b/src/waffle/core/wcore_display.h
@@ -25,12 +25,6 @@
#pragma once
-#include <stdbool.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-#include "waffle_display.h"
-
#include "api_object.h"
#include "wcore_util.h"
diff --git a/src/waffle/core/wcore_error.h b/src/waffle/core/wcore_error.h
index 764526c..7b127b8 100644
--- a/src/waffle/core/wcore_error.h
+++ b/src/waffle/core/wcore_error.h
@@ -38,7 +38,7 @@
#include <stdbool.h>
-#include "waffle_error.h"
+#include "waffle.h"
/// @brief Thread-local info for the wcore_error module.
struct wcore_error_tinfo;
diff --git a/src/waffle/core/wcore_window.h b/src/waffle/core/wcore_window.h
index a6c4df6..fc82111 100644
--- a/src/waffle/core/wcore_window.h
+++ b/src/waffle/core/wcore_window.h
@@ -25,11 +25,6 @@
#pragma once
-#include <stdbool.h>
-#include <stdlib.h>
-
-#include "waffle_window.h"
-
#include "wcore_config.h"
#include "wcore_util.h"
diff --git a/src/waffle/egl/wegl_config.c b/src/waffle/egl/wegl_config.c
index b0421e1..fb05287 100644
--- a/src/waffle/egl/wegl_config.c
+++ b/src/waffle/egl/wegl_config.c
@@ -26,8 +26,6 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
-#include "waffle_enum.h"
-
#include "wcore_config_attrs.h"
#include "wcore_error.h"
#include "wcore_platform.h"
diff --git a/src/waffle/egl/wegl_context.c b/src/waffle/egl/wegl_context.c
index c55dea4..a8320bf 100644
--- a/src/waffle/egl/wegl_context.c
+++ b/src/waffle/egl/wegl_context.c
@@ -26,8 +26,6 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
-#include "waffle_enum.h"
-
#include "wcore_error.h"
#include "wegl_config.h"
diff --git a/src/waffle/egl/wegl_display.c b/src/waffle/egl/wegl_display.c
index 121c8da..43c7167 100644
--- a/src/waffle/egl/wegl_display.c
+++ b/src/waffle/egl/wegl_display.c
@@ -25,9 +25,6 @@
#include <assert.h>
-#include "waffle_enum.h"
-#include "waffle_gl_misc.h"
-
#include "wcore_error.h"
#include "wcore_platform.h"
diff --git a/src/waffle/glx/glx_config.c b/src/waffle/glx/glx_config.c
index ce00f5a..1d7c059 100644
--- a/src/waffle/glx/glx_config.c
+++ b/src/waffle/glx/glx_config.c
@@ -26,8 +26,6 @@
#include <stdlib.h>
#include <string.h>
-#include "waffle_enum.h"
-
#include "linux_platform.h"
#include "wcore_config_attrs.h"
diff --git a/src/waffle/glx/glx_context.c b/src/waffle/glx/glx_context.c
index 07bbb60..e3a37ea 100644
--- a/src/waffle/glx/glx_context.c
+++ b/src/waffle/glx/glx_context.c
@@ -32,8 +32,6 @@
#include <assert.h>
#include <stdlib.h>
-#include "waffle_enum.h"
-
#include "wcore_error.h"
#include "glx_config.h"
diff --git a/src/waffle/glx/glx_display.c b/src/waffle/glx/glx_display.c
index 9fe788e..a29fb3c 100644
--- a/src/waffle/glx/glx_display.c
+++ b/src/waffle/glx/glx_display.c
@@ -25,9 +25,6 @@
#include <stdlib.h>
-#include "waffle_enum.h"
-#include "waffle_gl_misc.h"
-
#include "wcore_error.h"
#include "linux_platform.h"
diff --git a/src/waffle/linux/linux_dl.c b/src/waffle/linux/linux_dl.c
index 6b4b3f0..4f6a8b6 100644
--- a/src/waffle/linux/linux_dl.c
+++ b/src/waffle/linux/linux_dl.c
@@ -33,8 +33,6 @@
#include <dlfcn.h>
-#include "waffle_enum.h"
-
#include "wcore_error.h"
#include "wcore_util.h"
diff --git a/src/waffle/linux/linux_platform.c b/src/waffle/linux/linux_platform.c
index 4e24fa1..f612a54 100644
--- a/src/waffle/linux/linux_platform.c
+++ b/src/waffle/linux/linux_platform.c
@@ -30,8 +30,6 @@
#include <stdlib.h>
-#include "waffle_enum.h"
-
#include "wcore_error.h"
#include "wcore_util.h"