summaryrefslogtreecommitdiff
path: root/beos/beos_bitmap.cpp
diff options
context:
space:
mode:
authorFrançois Revel <mmu_man@netsurf-browser.org>2008-10-10 21:43:25 +0000
committerFrançois Revel <mmu_man@netsurf-browser.org>2008-10-10 21:43:25 +0000
commit4e79ee3d071df821f51f1a3f2d09bfedaa7af3b1 (patch)
tree75956bc92b844280da04395b9d80f2c4e6b324c7 /beos/beos_bitmap.cpp
parente4fba7f577d44f3235b2c430191d96ddfc084827 (diff)
downloadnetsurf-4e79ee3d071df821f51f1a3f2d09bfedaa7af3b1.tar.gz
netsurf-4e79ee3d071df821f51f1a3f2d09bfedaa7af3b1.tar.bz2
- support BITMAP_CLEAR_MEMORY in create_bitmap()
- copying to clipboard now constructs a text_run_array for StyledEdit, that is added to the clipboard. In applications supporting it it pastes the text with the correct fonts and sizes, and the text colors. - tried to find which line in source code the selection starts to open the editor there, but it's not finished so it's disabled. svn path=/trunk/netsurf/; revision=5533
Diffstat (limited to 'beos/beos_bitmap.cpp')
-rw-r--r--beos/beos_bitmap.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/beos/beos_bitmap.cpp b/beos/beos_bitmap.cpp
index 989fefc4a..0ee14d9b9 100644
--- a/beos/beos_bitmap.cpp
+++ b/beos/beos_bitmap.cpp
@@ -38,6 +38,7 @@ extern "C" {
#include "utils/log.h"
}
#include "beos/beos_bitmap.h"
+#include "beos/beos_gui.h"
#include "beos/beos_scaffolding.h"
struct bitmap {
@@ -105,14 +106,19 @@ static inline void nsbeos_rgba_to_bgra(void *src, void *dst, int width, int heig
void *bitmap_create(int width, int height, unsigned int state)
{
+ CALLED();
struct bitmap *bmp = (struct bitmap *)malloc(sizeof(struct bitmap));
if (bmp == NULL)
return NULL;
+ int32 flags = 0;
+ if (state & BITMAP_CLEAR_MEMORY)
+ flags |= B_BITMAP_CLEAR_TO_WHITE;
+
BRect frame(0, 0, width - 1, height - 1);
//XXX: bytes per row ?
- bmp->primary = new BBitmap(frame, 0, B_RGBA32);
- bmp->shadow = new BBitmap(frame, 0, B_RGBA32);
+ bmp->primary = new BBitmap(frame, flags, B_RGBA32);
+ bmp->shadow = new BBitmap(frame, flags, B_RGBA32);
bmp->pretile_x = bmp->pretile_y = bmp->pretile_xy = NULL;
@@ -286,6 +292,7 @@ bool bitmap_save(void *vbitmap, const char *path, unsigned flags)
* \param vbitmap a bitmap, as returned by bitmap_create()
*/
void bitmap_modified(void *vbitmap) {
+ CALLED();
struct bitmap *bitmap = (struct bitmap *)vbitmap;
// convert the shadow (ABGR) to into the primary bitmap
nsbeos_rgba_to_bgra(bitmap->shadow->Bits(), bitmap->primary->Bits(),