diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2015-03-24 14:00:47 +0000 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-04-10 11:58:24 +0100 |
commit | 37e1702f4f99f474935a2f383a69a7bbb52be3ed (patch) | |
tree | fdff02a5ef71ffeba799c5b64898fea6889153db | |
parent | 102e6be8182aed54f3388670aed49d3cc000f91c (diff) | |
download | waffle-37e1702f4f99f474935a2f383a69a7bbb52be3ed.tar.gz |
nacl: use nacl_container prefix on relevant functions
Improves core readability, plus it will ease the header cleanup coming
with the follow up commit(s).
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
-rw-r--r-- | src/waffle/nacl/nacl_container.cpp | 18 | ||||
-rw-r--r-- | src/waffle/nacl/nacl_container.h | 14 | ||||
-rw-r--r-- | src/waffle/nacl/nacl_context.c | 4 | ||||
-rw-r--r-- | src/waffle/nacl/nacl_platform.c | 6 | ||||
-rw-r--r-- | src/waffle/nacl/nacl_window.c | 6 |
5 files changed, 24 insertions, 24 deletions
diff --git a/src/waffle/nacl/nacl_container.cpp b/src/waffle/nacl/nacl_container.cpp index 92b3823..524d1d9 100644 --- a/src/waffle/nacl/nacl_container.cpp +++ b/src/waffle/nacl/nacl_container.cpp @@ -69,7 +69,7 @@ nacl_container_ctor() } static bool -nacl_context_init(waffle::nacl_container *nc, struct nacl_config *cfg) +nacl_container_context_init(waffle::nacl_container *nc, struct nacl_config *cfg) { // There is no way currently to pass a pp::Instance for Waffle, so // we fetch a map of all instances and if there's only one we select @@ -131,26 +131,26 @@ nacl_context_init(waffle::nacl_container *nc, struct nacl_config *cfg) }; // namespace waffle ends extern "C" struct nacl_container* -nacl_init() +nacl_container_init() { return reinterpret_cast<nacl_container*>(waffle::nacl_container_ctor()); } extern "C" void -nacl_teardown(nacl_container *nc) +nacl_container_teardown(nacl_container *nc) { waffle::nacl_container_dtor(reinterpret_cast<waffle::nacl_container*>(nc)); } extern "C" bool -nacl_context_init(struct nacl_container *nc, struct nacl_config *cfg) +nacl_container_context_init(struct nacl_container *nc, struct nacl_config *cfg) { - return waffle::nacl_context_init( + return waffle::nacl_container_context_init( reinterpret_cast<waffle::nacl_container*>(nc), cfg); } extern "C" void -nacl_context_fini(struct nacl_container *nc) +nacl_container_context_fini(struct nacl_container *nc) { waffle::nacl_container *cpp_nc = reinterpret_cast<waffle::nacl_container*>(nc); @@ -163,7 +163,7 @@ nacl_context_fini(struct nacl_container *nc) } extern "C" bool -nacl_resize(struct nacl_container *nc, int32_t width, int32_t height) +nacl_container_window_resize(struct nacl_container *nc, int32_t width, int32_t height) { waffle::nacl_container *cpp_nc = reinterpret_cast<waffle::nacl_container*>(nc); @@ -189,7 +189,7 @@ nacl_resize(struct nacl_container *nc, int32_t width, int32_t height) } extern "C" bool -nacl_makecurrent(nacl_container *nc, bool release) +nacl_container_context_makecurrent(nacl_container *nc, bool release) { waffle::nacl_container *cpp_nc = reinterpret_cast<waffle::nacl_container*>(nc); @@ -202,7 +202,7 @@ nacl_makecurrent(nacl_container *nc, bool release) } extern "C" bool -nacl_swapbuffers(nacl_container *nc) +nacl_container_swapbuffere(nacl_container *nc) { waffle::nacl_container *cpp_nc = reinterpret_cast<waffle::nacl_container*>(nc); diff --git a/src/waffle/nacl/nacl_container.h b/src/waffle/nacl/nacl_container.h index 6d0f70b..6a864a4 100644 --- a/src/waffle/nacl/nacl_container.h +++ b/src/waffle/nacl/nacl_container.h @@ -34,13 +34,13 @@ extern "C" { struct nacl_container; -struct nacl_container *nacl_init(); -void nacl_teardown(struct nacl_container *nc); -bool nacl_context_init(struct nacl_container *nc, struct nacl_config *cfg); -bool nacl_resize(struct nacl_container *nc, int32_t width, int32_t height); -bool nacl_makecurrent(struct nacl_container *nc, bool release); -void nacl_context_fini(struct nacl_container *nc); -bool nacl_swapbuffers(struct nacl_container *nc); +struct nacl_container *nacl_container_init(); +void nacl_container_teardown(struct nacl_container *nc); +bool nacl_container_context_init(struct nacl_container *nc, struct nacl_config *cfg); +bool nacl_container_window_resize(struct nacl_container *nc, int32_t width, int32_t height); +bool nacl_container_context_makecurrent(struct nacl_container *nc, bool release); +void nacl_container_context_fini(struct nacl_container *nc); +bool nacl_container_swapbuffere(struct nacl_container *nc); #ifdef __cplusplus }; #endif diff --git a/src/waffle/nacl/nacl_context.c b/src/waffle/nacl/nacl_context.c index 962c4d9..e67a913 100644 --- a/src/waffle/nacl/nacl_context.c +++ b/src/waffle/nacl/nacl_context.c @@ -40,7 +40,7 @@ nacl_context_destroy(struct wcore_context *wc_self) self = nacl_context(wc_self); - nacl_context_fini(nacl_plat->nacl); + nacl_container_context_fini(nacl_plat->nacl); ok &= wcore_context_teardown(wc_self); free(self); @@ -65,7 +65,7 @@ nacl_context_create(struct wcore_platform *wc_plat, if (!ok) goto error; - ok = nacl_context_init(platform->nacl, config); + ok = nacl_container_context_init(platform->nacl, config); if (!ok) goto error; diff --git a/src/waffle/nacl/nacl_platform.c b/src/waffle/nacl/nacl_platform.c index abaf729..b506113 100644 --- a/src/waffle/nacl/nacl_platform.c +++ b/src/waffle/nacl/nacl_platform.c @@ -42,7 +42,7 @@ nacl_platform_destroy(struct wcore_platform *wc_self) ok &= wcore_platform_teardown(wc_self); - nacl_teardown(self->nacl); + nacl_container_teardown(self->nacl); if (self->dl_gl) ok &= nacl_dl_close(&self->wcore); @@ -58,7 +58,7 @@ nacl_platform_make_current(struct wcore_platform *wc_self, struct wcore_context *wc_ctx) { bool release = (!wc_window && !wc_ctx); - return nacl_makecurrent(nacl_platform(wc_self)->nacl, + return nacl_container_context_makecurrent(nacl_platform(wc_self)->nacl, release); } @@ -76,7 +76,7 @@ nacl_platform_create(void) if (!ok) goto error; - self->nacl = nacl_init(); + self->nacl = nacl_container_init(); if (!self->nacl) goto error; diff --git a/src/waffle/nacl/nacl_window.c b/src/waffle/nacl/nacl_window.c index 5ac031c..2ec583b 100644 --- a/src/waffle/nacl/nacl_window.c +++ b/src/waffle/nacl/nacl_window.c @@ -70,7 +70,7 @@ nacl_window_create(struct wcore_platform *wc_plat, goto error; // Set requested dimensions for the backing surface. - if (!nacl_resize(nplat->nacl, width, height)) + if (!nacl_container_window_resize(nplat->nacl, width, height)) goto error; return &self->wcore; @@ -91,12 +91,12 @@ nacl_window_resize(struct wcore_window *wc_self, int32_t width, int32_t height) { struct nacl_platform *plat = nacl_platform(wc_self->display->platform); - return nacl_resize(plat->nacl, width, height); + return nacl_container_window_resize(plat->nacl, width, height); } bool nacl_window_swap_buffers(struct wcore_window *wc_self) { struct nacl_platform *plat = nacl_platform(wc_self->display->platform); - return nacl_swapbuffers(plat->nacl); + return nacl_container_swapbuffere(plat->nacl); } |