mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-03 19:48:29 +02:00
[boilerplate] Rename test-beos to boilerplate-beos
This commit is contained in:
parent
01760286b3
commit
fb2c0daa09
5 changed files with 50 additions and 49 deletions
|
|
@ -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
|
||||
|
|
|
|||
34
boilerplate/cairo-boilerplate-beos-private.h
Normal file
34
boilerplate/cairo-boilerplate-beos-private.h
Normal file
|
|
@ -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.h>
|
||||
|
||||
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
|
||||
|
|
@ -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<beos_test_closure*>(closure);
|
||||
beos_boilerplate_closure* bclosure = reinterpret_cast<beos_boilerplate_closure*>(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<beos_test_closure*>(closure);
|
||||
beos_boilerplate_closure* bclosure = reinterpret_cast<beos_boilerplate_closure*>(closure);
|
||||
|
||||
bclosure->bitmap->RemoveChild(bclosure->view);
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.h>
|
||||
|
||||
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
|
||||
Loading…
Add table
Reference in a new issue