diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am index f097d9e61..09d1f1f28 100644 --- a/boilerplate/Makefile.am +++ b/boilerplate/Makefile.am @@ -13,7 +13,8 @@ libcairoboilerplate_la_SOURCES += cairo-boilerplate-quartz-private.h endif if CAIRO_HAS_BEOS_SURFACE -libcairoboilerplate_la_SOURCES += cairo-test-beos.cpp cairo-test-beos.h +libcairoboilerplate_la_SOURCES += cairo-boilerplate-beos.cpp +libcairoboilerplate_la_SOURCES += cairo-boilerplate-beos-private.h # BeOS system headers trigger this warning libcairoboilerplate_la_CXXFLAGS = -Wno-multichar endif diff --git a/boilerplate/cairo-boilerplate-beos-private.h b/boilerplate/cairo-boilerplate-beos-private.h new file mode 100644 index 000000000..b572353ba --- /dev/null +++ b/boilerplate/cairo-boilerplate-beos-private.h @@ -0,0 +1,34 @@ +#ifndef _CAIRO_BOILERPLATE_BEOS_PRIVATE_H_ +#define _CAIRO_BOILERPLATE_BEOS_PRIVATE_H_ + +/* Two functions: One for a real window, one for a bitmap */ + +#include + +CAIRO_BEGIN_DECLS + +extern cairo_surface_t * +_cairo_boilerplate_beos_create_surface (const char *name, + cairo_content_t content, + int width, + int height, + cairo_boilerplate_mode_t mode, + void **closure); + +extern void +_cairo_boilerplate_beos_cleanup (void* closure); + +extern cairo_surface_t * +_cairo_boilerplate_beos_create_surface_for_bitmap (const char *name, + cairo_content_t content, + int width, + int height, + cairo_boilerplate_mode_t mode, + void **closure); + +extern void +_cairo_boilerplate_beos_cleanup_bitmap (void* closure); + +CAIRO_END_DECLS + +#endif diff --git a/boilerplate/cairo-test-beos.cpp b/boilerplate/cairo-boilerplate-beos.cpp similarity index 90% rename from boilerplate/cairo-test-beos.cpp rename to boilerplate/cairo-boilerplate-beos.cpp index 78831e8e1..2ebe29798 100644 --- a/boilerplate/cairo-test-beos.cpp +++ b/boilerplate/cairo-boilerplate-beos.cpp @@ -54,7 +54,7 @@ extern "C" { #include "cairo-boilerplate.h" } -#include "cairo-test-beos.h" +#include "cairo-boilerplate-beos-private.h" #include "cairo-beos.h" static int cairo_beos_boilerplate_log(const char* format, ...) { @@ -174,7 +174,7 @@ AppRunner::~AppRunner() // Make sure that the BApplication is initialized static AppRunner sAppRunner; -struct beos_test_closure +struct beos_boilerplate_closure { BView* view; BBitmap* bitmap; @@ -183,7 +183,7 @@ struct beos_test_closure // Test a real window cairo_surface_t * -create_beos_surface (const char *name, +_cairo_boilerplate_beos_create_surface (const char *name, cairo_content_t content, int width, int height, @@ -195,7 +195,7 @@ create_beos_surface (const char *name, BRect rect(0.0, 0.0, right, bottom); CairoTestWindow* wnd = new CairoTestWindow(rect, name); - beos_test_closure* bclosure = new beos_test_closure; + beos_boilerplate_closure* bclosure = new beos_boilerplate_closure; bclosure->view = wnd->View(); bclosure->bitmap = NULL; bclosure->window = wnd; @@ -206,9 +206,9 @@ create_beos_surface (const char *name, } void -cleanup_beos (void* closure) +_cairo_boilerplate_beos_cleanup (void* closure) { - beos_test_closure* bclosure = reinterpret_cast(closure); + beos_boilerplate_closure* bclosure = reinterpret_cast(closure); bclosure->window->Lock(); bclosure->window->Quit(); @@ -218,7 +218,7 @@ cleanup_beos (void* closure) // Test a bitmap cairo_surface_t * -create_beos_bitmap_surface (const char *name, +_cairo_boilerplate_beos_create_surface_for_bitmap (const char *name, cairo_content_t content, int width, int height, @@ -232,7 +232,7 @@ create_beos_bitmap_surface (const char *name, BView* view = new BView(rect, "Cairo test view", B_FOLLOW_ALL_SIDES, 0); bmp->AddChild(view); - beos_test_closure* bclosure = new beos_test_closure; + beos_boilerplate_closure* bclosure = new beos_boilerplate_closure; bclosure->view = view; bclosure->bitmap = bmp; bclosure->window = NULL; @@ -242,9 +242,9 @@ create_beos_bitmap_surface (const char *name, } void -cleanup_beos_bitmap (void* closure) +_cairo_boilerplate_beos_cleanup_bitmap (void* closure) { - beos_test_closure* bclosure = reinterpret_cast(closure); + beos_boilerplate_closure* bclosure = reinterpret_cast(closure); bclosure->bitmap->RemoveChild(bclosure->view); diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c index 79912b359..76c707387 100644 --- a/boilerplate/cairo-boilerplate.c +++ b/boilerplate/cairo-boilerplate.c @@ -1025,7 +1025,7 @@ cleanup_xlib (void *closure) #if CAIRO_HAS_BEOS_SURFACE /* BeOS test functions are external as they need to be C++ */ -#include "cairo-test-beos.h" +#include "cairo-boilerplate-beos-private.h" #endif #if CAIRO_HAS_DIRECTFB_SURFACE @@ -1504,11 +1504,11 @@ static cairo_boilerplate_target_t targets[] = * is related to the fact that it doesn't use premultiplied alpha... * Just ignore the small difference. */ { "beos", CAIRO_SURFACE_TYPE_BEOS, CAIRO_CONTENT_COLOR, 1, - create_beos_surface, cairo_surface_write_to_png, cleanup_beos}, + _cairo_boilerplate_beos_create_surface, cairo_surface_write_to_png, _cairo_boilerplate_beos_cleanup}, { "beos-bitmap", CAIRO_SURFACE_TYPE_BEOS, CAIRO_CONTENT_COLOR, 1, - create_beos_bitmap_surface, cairo_surface_write_to_png, cleanup_beos_bitmap}, + _cairo_boilerplate_beos_create_surface_for_bitmap, cairo_surface_write_to_png, _cairo_boilerplate_beos_cleanup_bitmap}, { "beos-bitmap", CAIRO_SURFACE_TYPE_BEOS, CAIRO_CONTENT_COLOR_ALPHA, 1, - create_beos_bitmap_surface, cairo_surface_write_to_png, cleanup_beos_bitmap}, + _cairo_boilerplate_beos_create_surface_for_bitmap, cairo_surface_write_to_png, _cairo_boilerplate_beos_cleanup_bitmap}, #endif #if CAIRO_HAS_DIRECTFB_SURFACE diff --git a/boilerplate/cairo-test-beos.h b/boilerplate/cairo-test-beos.h deleted file mode 100644 index 1e562cc3d..000000000 --- a/boilerplate/cairo-test-beos.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef CAIRO_TEST_BEOS_H_ -#define CAIRO_TEST_BEOS_H_ - -/* Two functions: One for a real window, one for a bitmap */ - -#include - -CAIRO_BEGIN_DECLS - -extern cairo_surface_t * -create_beos_surface (const char *name, - cairo_content_t content, - int width, - int height, - cairo_boilerplate_mode_t mode, - void **closure); - -extern void -cleanup_beos (void* closure); - -extern cairo_surface_t * -create_beos_bitmap_surface (const char *name, - cairo_content_t content, - int width, - int height, - cairo_boilerplate_mode_t mode, - void **closure); - -extern void -cleanup_beos_bitmap (void* closure); - -CAIRO_END_DECLS - -#endif