Commit f89a8f09 authored by Chad Versace's avatar Chad Versace

all: Declare vtbl functions in headers

This prepares for the next commit, which removes the vtbl from each
display, config, context, and window object.
Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
parent 16367527
......@@ -37,9 +37,6 @@
#include "droid_display.h"
#include "droid_surfaceflingerlink.h"
static bool
droid_config_destroy(struct wcore_config *wc_self);
static const struct wcore_config_vtbl droid_config_wcore_vtbl;
struct wcore_config*
......@@ -85,7 +82,7 @@ error:
return NULL;
}
static bool
bool
droid_config_destroy(struct wcore_config *wc_self)
{
struct droid_config *self = droid_config(wc_self);
......@@ -99,7 +96,7 @@ droid_config_destroy(struct wcore_config *wc_self)
return ok;
}
static union waffle_native_config*
union waffle_native_config*
droid_config_get_native(struct wcore_config *wc_self)
{
wcore_error(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
......
......@@ -59,3 +59,9 @@ struct wcore_config*
droid_config_choose(struct wcore_platform *wc_plat,
struct wcore_display *wc_dpy,
const struct wcore_config_attrs *attrs);
bool
droid_config_destroy(struct wcore_config *wc_self);
union waffle_native_config*
droid_config_get_native(struct wcore_config *wc_self);
......@@ -34,9 +34,6 @@
#include "droid_priv_egl.h"
#include "droid_surfaceflingerlink.h"
static bool
droid_context_destroy(struct wcore_context *wc_self);
static const struct wcore_context_vtbl droid_context_wcore_vtbl;
struct wcore_context*
......@@ -75,7 +72,7 @@ error:
return NULL;
}
static bool
bool
droid_context_destroy(struct wcore_context *wc_self)
{
struct droid_context *self = droid_context(wc_self);
......@@ -93,7 +90,7 @@ droid_context_destroy(struct wcore_context *wc_self)
return ok;
}
static union waffle_native_context*
union waffle_native_context*
droid_context_get_native(struct wcore_context *wc_self)
{
wcore_error(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
......
......@@ -48,3 +48,9 @@ struct wcore_context*
droid_context_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
struct wcore_context *wc_share_ctx);
bool
droid_context_destroy(struct wcore_context *wc_self);
union waffle_native_context*
droid_context_get_native(struct wcore_context *wc_self);
......@@ -35,9 +35,6 @@
#include "droid_priv_egl.h"
#include "droid_surfaceflingerlink.h"
static bool
droid_display_disconnect(struct wcore_display *wc_self);
static const struct wcore_display_vtbl droid_display_wcore_vtbl;
struct wcore_display*
......@@ -73,7 +70,7 @@ error:
return NULL;
}
static bool
bool
droid_display_disconnect(struct wcore_display *wc_self)
{
struct droid_display *self = droid_display(wc_self);
......@@ -92,14 +89,14 @@ droid_display_disconnect(struct wcore_display *wc_self)
return ok;
}
static union waffle_native_display*
union waffle_native_display*
droid_display_get_native(struct wcore_display *wc_self)
{
wcore_error(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
return NULL;
}
static bool
bool
droid_display_supports_context_api(
struct wcore_display *wc_self,
int32_t context_api)
......
......@@ -51,3 +51,13 @@ DEFINE_CONTAINER_CAST_FUNC(droid_display,
struct wcore_display*
droid_display_connect(struct wcore_platform *wc_plat,
const char *name);
bool
droid_display_disconnect(struct wcore_display *wc_self);
union waffle_native_display*
droid_display_get_native(struct wcore_display *wc_self);
bool
droid_display_supports_context_api(struct wcore_display *wc_self,
int32_t context_api);
......@@ -35,9 +35,6 @@
#include "droid_display.h"
#include "droid_surfaceflingerlink.h"
static bool
droid_window_destroy(struct wcore_window *wc_self);
static const struct wcore_window_vtbl droid_window_wcore_vtbl;
struct wcore_window*
......@@ -78,7 +75,7 @@ error:
return NULL;
}
static bool
bool
droid_window_destroy(struct wcore_window *wc_self)
{
struct droid_window *self = droid_window(wc_self);
......@@ -100,7 +97,7 @@ droid_window_destroy(struct wcore_window *wc_self)
return ok;
}
static bool
bool
droid_window_show(struct wcore_window *wc_self)
{
struct droid_window *self = droid_window(wc_self);
......@@ -114,7 +111,7 @@ droid_window_show(struct wcore_window *wc_self)
return droid_show_surface(dpy->pSFContainer, self->pANWContainer);
}
static union waffle_native_window*
union waffle_native_window*
droid_window_get_native(struct wcore_window *wc_self)
{
wcore_error(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
......@@ -122,7 +119,7 @@ droid_window_get_native(struct wcore_window *wc_self)
}
static bool
bool
droid_window_swap_buffers(struct wcore_window *wc_self)
{
struct droid_window *self = droid_window(wc_self);
......
......@@ -50,3 +50,15 @@ droid_window_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
int width,
int height);
bool
droid_window_destroy(struct wcore_window *wc_self);
bool
droid_window_show(struct wcore_window *wc_self);
bool
droid_window_swap_buffers(struct wcore_window *wc_self);
union waffle_native_window*
droid_window_get_native(struct wcore_window *wc_self);
......@@ -50,3 +50,9 @@ struct wcore_config*
cgl_config_choose(struct wcore_platform *wc_plat,
struct wcore_display *wc_dpy,
const struct wcore_config_attrs *attrs);
bool
cgl_config_destroy(struct wcore_config *wc_self);
union waffle_native_config*
cgl_config_get_native(struct wcore_config *wc_self);
......@@ -37,7 +37,7 @@
static const struct wcore_config_vtbl cgl_config_wcore_vtbl;
static bool
bool
cgl_config_destroy(struct wcore_config *wc_self)
{
bool ok = true;
......@@ -194,7 +194,7 @@ error:
return NULL;
}
static union waffle_native_config*
union waffle_native_config*
cgl_config_get_native(struct wcore_config *wc_self)
{
wcore_error(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
......
......@@ -50,3 +50,9 @@ struct wcore_context*
cgl_context_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
struct wcore_context *wc_share_ctx);
bool
cgl_context_destroy(struct wcore_context *wc_self);
union waffle_native_context*
cgl_context_get_native(struct wcore_context *wc_self);
......@@ -35,7 +35,7 @@
static const struct wcore_context_vtbl cgl_context_wcore_vtbl;
static bool
bool
cgl_context_destroy(struct wcore_context *wc_self)
{
struct cgl_context *self = cgl_context(wc_self);
......@@ -101,7 +101,7 @@ fail:
return NULL;
}
static union waffle_native_context*
union waffle_native_context*
cgl_context_get_native(struct wcore_context *wc_self)
{
wcore_error(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
......
......@@ -45,3 +45,13 @@ DEFINE_CONTAINER_CAST_FUNC(cgl_display,
struct wcore_display*
cgl_display_connect(struct wcore_platform *wc_plat,
const char *name);
bool
cgl_display_destroy(struct wcore_display *wc_self);
bool
cgl_display_supports_context_api(struct wcore_display *wc_self,
int32_t context_api);
union waffle_native_display*
cgl_display_get_native(struct wcore_display *wc_self);
......@@ -33,7 +33,7 @@
static const struct wcore_display_vtbl cgl_display_wcore_vtbl;
static bool
bool
cgl_display_destroy(struct wcore_display *wc_self)
{
struct cgl_display *self = cgl_display(wc_self);
......@@ -73,7 +73,7 @@ error:
return NULL;
}
static bool
bool
cgl_display_supports_context_api(struct wcore_display *wc_self,
int32_t context_api)
{
......@@ -91,7 +91,7 @@ cgl_display_supports_context_api(struct wcore_display *wc_self,
}
}
static union waffle_native_display*
union waffle_native_display*
cgl_display_get_native(struct wcore_display *wc_self)
{
wcore_error(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
......
......@@ -50,3 +50,15 @@ cgl_window_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
int width,
int height);
bool
cgl_window_destroy(struct wcore_window *wc_self);
bool
cgl_window_show(struct wcore_window *wc_self);
bool
cgl_window_swap_buffers(struct wcore_window *wc_self);
union waffle_native_window*
cgl_window_get_native(struct wcore_window *wc_self);
......@@ -33,7 +33,7 @@
static const struct wcore_window_vtbl cgl_window_wcore_vtbl;
static bool
bool
cgl_window_destroy(struct wcore_window *wc_self)
{
struct cgl_window *self = cgl_window(wc_self);
......@@ -127,13 +127,13 @@ error:
return NULL;
}
static bool
bool
cgl_window_show(struct wcore_window *wc_self)
{
return true;
}
static bool
bool
cgl_window_swap_buffers(struct wcore_window *wc_self)
{
struct cgl_window *self = cgl_window(wc_self);
......@@ -142,7 +142,7 @@ cgl_window_swap_buffers(struct wcore_window *wc_self)
}
static union waffle_native_window*
union waffle_native_window*
cgl_window_get_native(struct wcore_window *wc_self)
{
wcore_error(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
......
......@@ -40,7 +40,7 @@
static const struct wcore_config_vtbl wgbm_config_wcore_vtbl;
static bool
bool
wgbm_config_destroy(struct wcore_config *wc_self)
{
struct wgbm_config *self = wgbm_config(wc_self);
......@@ -111,7 +111,7 @@ error:
return NULL;
}
static union waffle_native_config*
union waffle_native_config*
wgbm_config_get_native(struct wcore_config *wc_self)
{
struct wgbm_config *self = wgbm_config(wc_self);
......
......@@ -58,3 +58,9 @@ struct wcore_config*
wgbm_config_choose(struct wcore_platform *wc_plat,
struct wcore_display *wc_dpy,
const struct wcore_config_attrs *attrs);
bool
wgbm_config_destroy(struct wcore_config *wc_self);
union waffle_native_config*
wgbm_config_get_native(struct wcore_config *wc_self);
......@@ -37,7 +37,7 @@
static const struct wcore_context_vtbl wgbm_context_wcore_vtbl;
static bool
bool
wgbm_context_destroy(struct wcore_context *wc_self)
{
struct wgbm_context *self = wgbm_context(wc_self);
......@@ -91,7 +91,7 @@ error:
return NULL;
}
static union waffle_native_context*
union waffle_native_context*
wgbm_context_get_native(struct wcore_context *wc_self)
{
struct wgbm_context *self = wgbm_context(wc_self);
......
......@@ -49,3 +49,9 @@ struct wcore_context*
wgbm_context_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
struct wcore_context *wc_share_ctx);
bool
wgbm_context_destroy(struct wcore_context *wc_self);
union waffle_native_context*
wgbm_context_get_native(struct wcore_context *wc_self);
......@@ -45,7 +45,7 @@
static const struct wcore_display_vtbl wgbm_display_wcore_vtbl;
static bool
bool
wgbm_display_destroy(struct wcore_display *wc_self)
{
struct wgbm_display *self = wgbm_display(wc_self);
......@@ -145,7 +145,7 @@ error:
}
static bool
bool
wgbm_display_supports_context_api(struct wcore_display *wc_self,
int32_t waffle_context_api)
{
......@@ -160,7 +160,7 @@ wgbm_display_fill_native(struct wgbm_display *self,
n_dpy->egl_display = self->egl;
}
static union waffle_native_display*
union waffle_native_display*
wgbm_display_get_native(struct wcore_display *wc_self)
{
struct wgbm_display *self = wgbm_display(wc_self);
......
......@@ -54,6 +54,16 @@ struct wcore_display*
wgbm_display_connect(struct wcore_platform *wc_plat,
const char *name);
bool
wgbm_display_destroy(struct wcore_display *wc_self);
bool
wgbm_display_supports_context_api(struct wcore_display *wc_self,
int32_t waffle_context_api);
union waffle_native_display*
wgbm_display_get_native(struct wcore_display *wc_self);
void
wgbm_display_fill_native(struct wgbm_display *self,
struct waffle_gbm_display *n_dpy);
......@@ -40,7 +40,7 @@
static const struct wcore_window_vtbl wgbm_window_wcore_vtbl;
static bool
bool
wgbm_window_destroy(struct wcore_window *wc_self)
{
struct wgbm_window *self = wgbm_window(wc_self);
......@@ -104,13 +104,13 @@ error:
}
static bool
bool
wgbm_window_show(struct wcore_window *wc_self)
{
return true;
}
static bool
bool
wgbm_window_swap_buffers(struct wcore_window *wc_self)
{
struct wgbm_window *self = wgbm_window(wc_self);
......@@ -119,7 +119,7 @@ wgbm_window_swap_buffers(struct wcore_window *wc_self)
return egl_swap_buffers(dpy->egl, self->egl);
}
static union waffle_native_window*
union waffle_native_window*
wgbm_window_get_native(struct wcore_window *wc_self)
{
struct wgbm_window *self = wgbm_window(wc_self);
......
......@@ -51,3 +51,15 @@ wgbm_window_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
int width,
int height);
bool
wgbm_window_destroy(struct wcore_window *wc_self);
bool
wgbm_window_show(struct wcore_window *wc_self);
bool
wgbm_window_swap_buffers(struct wcore_window *wc_self);
union waffle_native_window*
wgbm_window_get_native(struct wcore_window *wc_self);
......@@ -38,7 +38,7 @@
static const struct wcore_config_vtbl glx_config_wcore_vtbl;
static bool
bool
glx_config_destroy(struct wcore_config *wc_self)
{
bool ok = true;
......@@ -222,7 +222,7 @@ cleanup:
return &self->wcore;
}
static union waffle_native_config*
union waffle_native_config*
glx_config_get_native(struct wcore_config *wc_self)
{
struct glx_config *self = glx_config(wc_self);
......
......@@ -59,3 +59,9 @@ struct wcore_config*
glx_config_choose(struct wcore_platform *wc_plat,
struct wcore_display *wc_dpy,
const struct wcore_config_attrs *attrs);
bool
glx_config_destroy(struct wcore_config *wc_self);
union waffle_native_config*
glx_config_get_native(struct wcore_config *wc_self);
......@@ -44,7 +44,7 @@ enum {
};
static bool
bool
glx_context_destroy(struct wcore_context *wc_self)
{
struct glx_context *self;
......@@ -182,7 +182,7 @@ error:
return NULL;
}
static union waffle_native_context*
union waffle_native_context*
glx_context_get_native(struct wcore_context *wc_self)
{
struct glx_context *self = glx_context(wc_self);
......
......@@ -49,3 +49,9 @@ struct wcore_context*
glx_context_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
struct wcore_context *wc_share_ctx);
bool
glx_context_destroy(struct wcore_context *wc_self);
union waffle_native_context*
glx_context_get_native(struct wcore_context *wc_self);
......@@ -36,7 +36,7 @@
static const struct wcore_display_vtbl glx_display_wcore_vtbl;
static bool
bool
glx_display_destroy(struct wcore_display *wc_self)
{
struct glx_display *self = glx_display(wc_self);
......@@ -101,7 +101,7 @@ error:
return NULL;
}
static bool
bool
glx_display_supports_context_api(struct wcore_display *wc_self,
int32_t context_api)
{
......@@ -124,7 +124,7 @@ glx_display_supports_context_api(struct wcore_display *wc_self,
}
}
static union waffle_native_display*
union waffle_native_display*
glx_display_get_native(struct wcore_display *wc_self)
{
struct glx_display *self = glx_display(wc_self);
......
......@@ -57,3 +57,13 @@ DEFINE_CONTAINER_CAST_FUNC(glx_display,
struct wcore_display*
glx_display_connect(struct wcore_platform *wc_plat,
const char *name);
bool
glx_display_destroy(struct wcore_display *wc_self);
bool
glx_display_supports_context_api(struct wcore_display *wc_self,
int32_t context_api);
union waffle_native_display*
glx_display_get_native(struct wcore_display *wc_self);
......@@ -34,7 +34,7 @@
static const struct wcore_window_vtbl glx_window_wcore_vtbl;
static bool
bool
glx_window_destroy(struct wcore_window *wc_self)
{
struct glx_window *self = glx_window(wc_self);
......@@ -84,13 +84,13 @@ error:
return NULL;
}
static bool
bool
glx_window_show(struct wcore_window *wc_self)
{
return x11_window_show(&glx_window(wc_self)->x11);
}
static bool
bool
glx_window_swap_buffers(struct wcore_window *wc_self)
{
struct glx_window *self = glx_window(wc_self);
......@@ -101,7 +101,7 @@ glx_window_swap_buffers(struct wcore_window *wc_self)
return true;
}
static union waffle_native_window*
union waffle_native_window*
glx_window_get_native(struct wcore_window *wc_self)
{
struct glx_window *self = glx_window(wc_self);
......
......@@ -49,3 +49,15 @@ glx_window_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
int width,
int height);
bool
glx_window_destroy(struct wcore_window *wc_self);
bool
glx_window_show(struct wcore_window *wc_self);
bool
glx_window_swap_buffers(struct wcore_window *wc_self);
union waffle_native_window*
glx_window_get_native(struct wcore_window *wc_self);
......@@ -38,7 +38,7 @@
static const struct wcore_config_vtbl wayland_config_wcore_vtbl;
static bool
bool
wayland_config_destroy(struct wcore_config *wc_self)
{
struct wayland_config *self = wayland_config(wc_self);
......@@ -86,7 +86,7 @@ error:
return NULL;
}
static union waffle_native_config*
union waffle_native_config*
wayland_config_get_native(struct wcore_config *wc_self)
{
struct wayland_config *self = wayland_config(wc_self);
......
......@@ -56,3 +56,9 @@ struct wcore_config*
wayland_config_choose(struct wcore_platform *wc_plat,
struct wcore_display *wc_dpy,
const struct wcore_config_attrs *attrs);
bool
wayland_config_destroy(struct wcore_config *wc_self);
union waffle_native_config*
wayland_config_get_native(struct wcore_config *wc_self);
......@@ -37,7 +37,7 @@
static const struct wcore_context_vtbl wayland_context_wcore_vtbl;
static bool
bool
wayland_context_destroy(struct wcore_context *wc_self)
{
struct wayland_context *self = wayland_context(wc_self);
......@@ -91,7 +91,7 @@ error:
return NULL;
}
static union waffle_native_context*
union waffle_native_context*
wayland_context_get_native(struct wcore_context *wc_self)
{
struct wayland_context *self = wayland_context(wc_self);
......
......@@ -49,3 +49,9 @@ struct wcore_context*
wayland_context_create(struct wcore_platform *wc_plat,
struct wcore_config *wc_config,
struct wcore_context *wc_share_ctx);
bool
wayland_context_destroy(struct wcore_context *wc_self);
union waffle_native_context*
wayland_context_get_native(struct wcore_context *wc_self);
......@@ -40,7 +40,7 @@
static const struct wcore_display_vtbl wayland_display_wcore_vtbl;
static bool
bool
wayland_display_destroy(struct wcore_display *wc_self)
{
struct wayland_display *self = wayland_display(wc_self);
......@@ -139,7 +139,7 @@ error:
}
static bool
bool
wayland_display_supports_context_api(struct wcore_display *wc_self,
int32_t waffle_context_api)
{
......@@ -156,7 +156,7 @@ wayland_display_fill_native(struct wayland_display *self,
n_dpy->egl_display = self->egl;
}
static union waffle_native_display*
union waffle_native_display*
wayland_display_get_native(struct wcore_display *wc_self)
{
struct wayland_display *self = wayland_display(wc_self);
......
......@@ -59,6 +59,16 @@ struct wcore_display*
wayland_display_connect(struct wcore_platform *wc_plat,
const char *name);
bool
wayland_display_destroy(struct wcore_display *wc_self);
bool
wayland_display_supports_context_api(struct wcore_display *wc_self,
int32_t waffle_context_api);
void
wayland_display_fill_native(struct wayland_display *self,
struct waffle_wayland_display *n_dpy);
union waffle_native_display*