r6649 vince - /trunk/netsurf/framebuffer/fb_font_freetype.c
by netsurf@semichrome.net
Author: vince
Date: Thu Feb 26 17:43:18 2009
New Revision: 6649
URL: http://source.netsurf-browser.org?rev=6649&view=rev
Log:
allow glyph cache to grow to 2MB not 200k
Modified:
trunk/netsurf/framebuffer/fb_font_freetype.c
Modified: trunk/netsurf/framebuffer/fb_font_freetype.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_font_freet...
==============================================================================
--- trunk/netsurf/framebuffer/fb_font_freetype.c (original)
+++ trunk/netsurf/framebuffer/fb_font_freetype.c Thu Feb 26 17:43:18 2009
@@ -115,6 +115,8 @@
bool fb_font_init(void)
{
FT_Error error;
+ FT_ULong max_cache_size;
+ FT_UInt max_faces = 6;
/* freetype library initialise */
error = FT_Init_FreeType( &library );
@@ -123,8 +125,16 @@
return false;
}
- /* cache manager initialise, six faces and defaults for other values */
- error = FTC_Manager_New(library, 6, 0, 0, ft_face_requester, NULL, &ft_cmanager);
+ max_cache_size = 2 * 1024 *1024; /* 2MB should be enough */
+
+ /* cache manager initialise */
+ error = FTC_Manager_New(library,
+ max_faces,
+ 0,
+ max_cache_size,
+ ft_face_requester,
+ NULL,
+ &ft_cmanager);
if (error) {
LOG(("Freetype could not initialise cache manager (code %d)\n", error));
FT_Done_FreeType(library);
@@ -162,6 +172,7 @@
bool fb_font_finalise(void)
{
+ FTC_Manager_Done(ft_cmanager );
FT_Done_FreeType(library);
return true;
}
14 years, 3 months
r6648 tlsa - in /trunk/netsurf/framebuffer: fb_16bpp_plotters.c fb_32bpp_plotters.c
by netsurf@semichrome.net
Author: tlsa
Date: Thu Feb 26 17:41:34 2009
New Revision: 6648
URL: http://source.netsurf-browser.org?rev=6648&view=rev
Log:
Revert r6647.
Modified:
trunk/netsurf/framebuffer/fb_16bpp_plotters.c
trunk/netsurf/framebuffer/fb_32bpp_plotters.c
Modified: trunk/netsurf/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_16bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_16bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_16bpp_plotters.c Thu Feb 26 17:41:34 2009
@@ -33,14 +33,14 @@
static inline uint16_t *
fb_16bpp_get_xy_loc(int x, int y)
{
- return (void *)(framebuffer->ptr +
- (y * framebuffer->linelen) +
+ return (void *)(framebuffer->ptr +
+ (y * framebuffer->linelen) +
(x << 1));
}
static inline colour fb_16bpp_to_colour(uint16_t pixel)
{
- return ((pixel & 0x1F) << 19) |
+ return ((pixel & 0x1F) << 19) |
((pixel & 0x7E0) << 5) |
((pixel & 0xF800) >> 8);
}
@@ -114,7 +114,7 @@
x = dyabs >> 1;
y = dxabs >> 1;
- if (dxabs >= dyabs) {
+ if (dxabs >= dyabs) {
/* the line is more horizontal than vertical */
for (i = 0; i <= dxabs; i++) {
*pvideo = ent;
@@ -139,7 +139,7 @@
}
}
}
-
+
}
@@ -240,7 +240,7 @@
uint32_t fgcol;
/* The part of the scaled image actually displayed is cropped to the
- * current context.
+ * current context.
*/
x0 = x;
y0 = y;
@@ -269,7 +269,7 @@
abpixel = (pixel[((yoff + yloop) * bp->pitch) + xloop + xoff] << 24) | fgcol;
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
- abpixel = fb_plotters_ablend(abpixel,
+ abpixel = fb_plotters_ablend(abpixel,
fb_16bpp_to_colour(*(pvideo + xloop)));
}
@@ -301,17 +301,17 @@
if (glyph->format == FT_GLYPH_FORMAT_BITMAP) {
bglyph = (FT_BitmapGlyph)glyph;
- /* now, draw to our target surface */
+ /* now, draw to our target surface */
if (bglyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
- fb_16bpp_draw_ft_monobitmap(&bglyph->bitmap,
- x + bglyph->left,
+ fb_16bpp_draw_ft_monobitmap(&bglyph->bitmap,
+ x + bglyph->left,
y - bglyph->top,
- c);
+ c);
} else {
- fb_16bpp_draw_ft_bitmap(&bglyph->bitmap,
- x + bglyph->left,
+ fb_16bpp_draw_ft_bitmap(&bglyph->bitmap,
+ x + bglyph->left,
y - bglyph->top,
- c);
+ c);
}
}
x += glyph->advance.x >> 16;
@@ -341,7 +341,7 @@
/* aquire thge text in local font encoding */
utf8_to_font_encoding(fb_font, text, length, (char **)&buffer);
- if (!buffer)
+ if (!buffer)
return true;
length = strlen((char *)buffer);
@@ -350,7 +350,7 @@
y-=((fb_font->height * 75)/100);
y+=1; /* the coord is the bottom-left of the pixels offset by 1 to make
- * it work since fb coords are the top-left of pixels
+ * it work since fb coords are the top-left of pixels
*/
/* The part of the text displayed is cropped to the current context. */
@@ -380,7 +380,7 @@
if ((x + fb_font->width) > x1)
break;
- if (x < x0)
+ if (x < x0)
continue;
pvideo = fb_16bpp_get_xy_loc(x, y0);
@@ -432,11 +432,11 @@
int x0,y0,x1,y1;
int xoff, yoff; /* x and y offset into image */
- /* LOG(("x %d, y %d, width %d, height %d, bitmap %p, content %p",
+ /* LOG(("x %d, y %d, width %d, height %d, bitmap %p, content %p",
x,y,width,height,bitmap,content));*/
/* TODO here we should scale the image from bitmap->width to width, for
- * now simply crop.
+ * now simply crop.
*/
if (width > bitmap->width)
width = bitmap->width;
@@ -445,7 +445,7 @@
height = bitmap->height;
/* The part of the scaled image actually displayed is cropped to the
- * current context.
+ * current context.
*/
x0 = x;
y0 = y;
@@ -462,18 +462,17 @@
width = (x1 - x0);
xoff = x0 - x;
- yoff = (y0 - y) * bitmap->width;
- height *= bitmap->width;
+ yoff = y0 - y;
/* plot the image */
pvideo = fb_16bpp_get_xy_loc(x0, y0);
- for (yloop = yoff; yloop < height; yloop += bitmap->width) {
+ for (yloop = 0; yloop < height; yloop++) {
for (xloop = 0; xloop < width; xloop++) {
- abpixel = pixel[yloop + xloop + xoff];
+ abpixel = pixel[((yoff + yloop) * bitmap->width) + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
- abpixel = fb_plotters_ablend(abpixel,
+ abpixel = fb_plotters_ablend(abpixel,
fb_16bpp_to_colour(*(pvideo + xloop)));
}
@@ -491,7 +490,7 @@
bool repeat_x, bool repeat_y,
struct content *content)
{
- return fb_plotters_bitmap_tile(x, y, width, height,
+ return fb_plotters_bitmap_tile(x, y, width, height,
bitmap, bg, repeat_x, repeat_y,
content, fb_16bpp_bitmap);
}
Modified: trunk/netsurf/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_32bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_32bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_32bpp_plotters.c Thu Feb 26 17:41:34 2009
@@ -33,16 +33,16 @@
static inline uint32_t *
fb_32bpp_get_xy_loc(int x, int y)
{
- return (uint32_t *)(framebuffer->ptr +
- (y * framebuffer->linelen) +
+ return (uint32_t *)(framebuffer->ptr +
+ (y * framebuffer->linelen) +
(x << 2));
}
#if __BYTE_ORDER == __BIG_ENDIAN
static inline colour fb_32bpp_to_colour(uint32_t pixel)
{
- return ((pixel & 0xFF00) >> 8) |
- ((pixel & 0xFF0000) >> 8) |
+ return ((pixel & 0xFF00) >> 8) |
+ ((pixel & 0xFF0000) >> 8) |
((pixel & 0xFF000000) >> 8);
}
@@ -54,8 +54,8 @@
#else
static inline colour fb_32bpp_to_colour(uint32_t pixel)
{
- return ((pixel & 0xFF) << 16) |
- ((pixel & 0xFF00)) |
+ return ((pixel & 0xFF) << 16) |
+ ((pixel & 0xFF00)) |
((pixel & 0xFF0000) >> 16);
}
@@ -121,7 +121,7 @@
x = dyabs >> 1;
y = dxabs >> 1;
- if (dxabs >= dyabs) {
+ if (dxabs >= dyabs) {
/* the line is more horizontal than vertical */
for (i = 0; i <= dxabs; i++) {
*pvideo = ent;
@@ -146,7 +146,7 @@
}
}
}
-
+
}
return true;
@@ -191,7 +191,7 @@
pvid = fb_32bpp_get_xy_loc(x0, y0);
while (height-- > 0) {
- for (w = width; w > 0; w--) *pvid++ = ent;
+ for (w = width; w > 0; w--) *pvid++ = ent;
pvid += llen;
}
@@ -200,10 +200,10 @@
static bool fb_32bpp_clg(colour c)
{
- fb_32bpp_fill(fb_plot_ctx.x0,
- fb_plot_ctx.y0,
- fb_plot_ctx.x1,
- fb_plot_ctx.y1,
+ fb_32bpp_fill(fb_plot_ctx.x0,
+ fb_plot_ctx.y0,
+ fb_plot_ctx.x1,
+ fb_plot_ctx.y1,
c);
return true;
}
@@ -234,7 +234,7 @@
y+=1; /* the coord is the bottom-left of the pixels offset by 1 to make
- * it work since fb coords are the top-left of pixels
+ * it work since fb coords are the top-left of pixels
*/
/* The part of the text displayed is cropped to the current context. */
@@ -267,16 +267,16 @@
if ((xloop % 8) == 0) {
row = *fntd++;
}
-
+
if ((row & 0x80) != 0) {
*(pvideo + xloop) = fgcol;
- }
+ }
row = row << 1;
}
pvideo += (framebuffer->linelen >> 2);
}
-
+
return true;
}
@@ -295,7 +295,7 @@
uint32_t fgcol;
/* The part of the scaled image actually displayed is cropped to the
- * current context.
+ * current context.
*/
x0 = x;
y0 = y;
@@ -325,7 +325,7 @@
if ((abpixel & 0xFF000000) != 0) {
/* pixel is not transparent */
if ((abpixel & 0xFF000000) != 0xFF000000) {
- abpixel = fb_plotters_ablend(abpixel,
+ abpixel = fb_plotters_ablend(abpixel,
fb_32bpp_to_colour(*(pvideo + xloop)));
}
@@ -351,23 +351,23 @@
nxtchr = utf8_next(text, length, nxtchr);
glyph = fb_getglyph(style, ucs4);
- if (glyph == NULL)
+ if (glyph == NULL)
continue;
if (glyph->format == FT_GLYPH_FORMAT_BITMAP) {
bglyph = (FT_BitmapGlyph)glyph;
- /* now, draw to our target surface */
+ /* now, draw to our target surface */
if (bglyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
- fb_32bpp_draw_ft_monobitmap(&bglyph->bitmap,
- x + bglyph->left,
+ fb_32bpp_draw_ft_monobitmap(&bglyph->bitmap,
+ x + bglyph->left,
y - bglyph->top,
- c);
+ c);
} else {
- fb_32bpp_draw_ft_bitmap(&bglyph->bitmap,
- x + bglyph->left,
+ fb_32bpp_draw_ft_bitmap(&bglyph->bitmap,
+ x + bglyph->left,
y - bglyph->top,
- c);
+ c);
}
}
x += glyph->advance.x >> 16;
@@ -395,7 +395,7 @@
/* aquire thge text in local font encoding */
utf8_to_font_encoding(fb_font, text, length, (char**)&buffer);
- if (!buffer)
+ if (!buffer)
return true;
length = strlen((char *)buffer);
@@ -404,7 +404,7 @@
y-=((fb_font->height * 75)/100);
y+=1; /* the coord is the bottom-left of the pixels offset by 1 to make
- * it work since fb coords are the top-left of pixels
+ * it work since fb coords are the top-left of pixels
*/
/* The part of the text displayed is cropped to the current context. */
@@ -434,7 +434,7 @@
if ((x + fb_font->width) > x1)
break;
- if (x < x0)
+ if (x < x0)
continue;
pvideo = fb_32bpp_get_xy_loc(x, y0);
@@ -478,7 +478,7 @@
static bool fb_32bpp_bitmap(int x, int y, int width, int height,
- struct bitmap *bitmap, colour bg,
+ struct bitmap *bitmap, colour bg,
struct content *content)
{
uint32_t *pvideo;
@@ -488,11 +488,11 @@
int x0,y0,x1,y1;
int xoff, yoff; /* x and y offset into image */
- /* LOG(("x %d, y %d, width %d, height %d, bitmap %p, content %p",
+ /* LOG(("x %d, y %d, width %d, height %d, bitmap %p, content %p",
x,y,width,height,bitmap,content));*/
/* TODO here we should scale the image from bitmap->width to width, for
- * now simply crop.
+ * now simply crop.
*/
if (width > bitmap->width)
width = bitmap->width;
@@ -501,7 +501,7 @@
height = bitmap->height;
/* The part of the scaled image actually displayed is cropped to the
- * current context.
+ * current context.
*/
x0 = x;
y0 = y;
@@ -518,18 +518,17 @@
width = (x1 - x0);
xoff = x0 - x;
- yoff = (y0 - y) * bitmap->width;
- height *= bitmap->width;
+ yoff = y0 - y;
/* plot the image */
pvideo = fb_32bpp_get_xy_loc(x0, y0);
- for (yloop = yoff; yloop < height; yloop += bitmap->width) {
+ for (yloop = 0; yloop < height; yloop++) {
for (xloop = 0; xloop < width; xloop++) {
- abpixel = pixel[yloop + xloop + xoff];
+ abpixel = pixel[((yoff + yloop) * bitmap->width) + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
- abpixel = fb_plotters_ablend(abpixel,
+ abpixel = fb_plotters_ablend(abpixel,
fb_32bpp_to_colour(*(pvideo + xloop)));
}
@@ -545,10 +544,10 @@
static bool fb_32bpp_bitmap_tile(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
- bool repeat_x, bool repeat_y,
+ bool repeat_x, bool repeat_y,
struct content *content)
{
- return fb_plotters_bitmap_tile(x, y, width, height,
+ return fb_plotters_bitmap_tile(x, y, width, height,
bitmap, bg, repeat_x, repeat_y,
content, fb_32bpp_bitmap);
}
@@ -579,7 +578,7 @@
.arc = fb_32bpp_arc,
.bitmap = fb_32bpp_bitmap,
.bitmap_tile = fb_32bpp_bitmap_tile,
- .flush = fb_32bpp_flush,
+ .flush = fb_32bpp_flush,
.path = fb_32bpp_path,
.option_knockout = true,
};
14 years, 3 months
r6647 tlsa - in /trunk/netsurf/framebuffer: fb_16bpp_plotters.c fb_32bpp_plotters.c
by netsurf@semichrome.net
Author: tlsa
Date: Thu Feb 26 17:05:06 2009
New Revision: 6647
URL: http://source.netsurf-browser.org?rev=6647&view=rev
Log:
Possibly slightly faster bitmap plotter.
Modified:
trunk/netsurf/framebuffer/fb_16bpp_plotters.c
trunk/netsurf/framebuffer/fb_32bpp_plotters.c
Modified: trunk/netsurf/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_16bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_16bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_16bpp_plotters.c Thu Feb 26 17:05:06 2009
@@ -33,14 +33,14 @@
static inline uint16_t *
fb_16bpp_get_xy_loc(int x, int y)
{
- return (void *)(framebuffer->ptr +
- (y * framebuffer->linelen) +
+ return (void *)(framebuffer->ptr +
+ (y * framebuffer->linelen) +
(x << 1));
}
static inline colour fb_16bpp_to_colour(uint16_t pixel)
{
- return ((pixel & 0x1F) << 19) |
+ return ((pixel & 0x1F) << 19) |
((pixel & 0x7E0) << 5) |
((pixel & 0xF800) >> 8);
}
@@ -114,7 +114,7 @@
x = dyabs >> 1;
y = dxabs >> 1;
- if (dxabs >= dyabs) {
+ if (dxabs >= dyabs) {
/* the line is more horizontal than vertical */
for (i = 0; i <= dxabs; i++) {
*pvideo = ent;
@@ -139,7 +139,7 @@
}
}
}
-
+
}
@@ -240,7 +240,7 @@
uint32_t fgcol;
/* The part of the scaled image actually displayed is cropped to the
- * current context.
+ * current context.
*/
x0 = x;
y0 = y;
@@ -269,7 +269,7 @@
abpixel = (pixel[((yoff + yloop) * bp->pitch) + xloop + xoff] << 24) | fgcol;
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
- abpixel = fb_plotters_ablend(abpixel,
+ abpixel = fb_plotters_ablend(abpixel,
fb_16bpp_to_colour(*(pvideo + xloop)));
}
@@ -301,17 +301,17 @@
if (glyph->format == FT_GLYPH_FORMAT_BITMAP) {
bglyph = (FT_BitmapGlyph)glyph;
- /* now, draw to our target surface */
+ /* now, draw to our target surface */
if (bglyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
- fb_16bpp_draw_ft_monobitmap(&bglyph->bitmap,
- x + bglyph->left,
+ fb_16bpp_draw_ft_monobitmap(&bglyph->bitmap,
+ x + bglyph->left,
y - bglyph->top,
- c);
+ c);
} else {
- fb_16bpp_draw_ft_bitmap(&bglyph->bitmap,
- x + bglyph->left,
+ fb_16bpp_draw_ft_bitmap(&bglyph->bitmap,
+ x + bglyph->left,
y - bglyph->top,
- c);
+ c);
}
}
x += glyph->advance.x >> 16;
@@ -341,7 +341,7 @@
/* aquire thge text in local font encoding */
utf8_to_font_encoding(fb_font, text, length, (char **)&buffer);
- if (!buffer)
+ if (!buffer)
return true;
length = strlen((char *)buffer);
@@ -350,7 +350,7 @@
y-=((fb_font->height * 75)/100);
y+=1; /* the coord is the bottom-left of the pixels offset by 1 to make
- * it work since fb coords are the top-left of pixels
+ * it work since fb coords are the top-left of pixels
*/
/* The part of the text displayed is cropped to the current context. */
@@ -380,7 +380,7 @@
if ((x + fb_font->width) > x1)
break;
- if (x < x0)
+ if (x < x0)
continue;
pvideo = fb_16bpp_get_xy_loc(x, y0);
@@ -432,11 +432,11 @@
int x0,y0,x1,y1;
int xoff, yoff; /* x and y offset into image */
- /* LOG(("x %d, y %d, width %d, height %d, bitmap %p, content %p",
+ /* LOG(("x %d, y %d, width %d, height %d, bitmap %p, content %p",
x,y,width,height,bitmap,content));*/
/* TODO here we should scale the image from bitmap->width to width, for
- * now simply crop.
+ * now simply crop.
*/
if (width > bitmap->width)
width = bitmap->width;
@@ -445,7 +445,7 @@
height = bitmap->height;
/* The part of the scaled image actually displayed is cropped to the
- * current context.
+ * current context.
*/
x0 = x;
y0 = y;
@@ -462,17 +462,18 @@
width = (x1 - x0);
xoff = x0 - x;
- yoff = y0 - y;
+ yoff = (y0 - y) * bitmap->width;
+ height *= bitmap->width;
/* plot the image */
pvideo = fb_16bpp_get_xy_loc(x0, y0);
- for (yloop = 0; yloop < height; yloop++) {
+ for (yloop = yoff; yloop < height; yloop += bitmap->width) {
for (xloop = 0; xloop < width; xloop++) {
- abpixel = pixel[((yoff + yloop) * bitmap->width) + xloop + xoff];
+ abpixel = pixel[yloop + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
- abpixel = fb_plotters_ablend(abpixel,
+ abpixel = fb_plotters_ablend(abpixel,
fb_16bpp_to_colour(*(pvideo + xloop)));
}
@@ -490,7 +491,7 @@
bool repeat_x, bool repeat_y,
struct content *content)
{
- return fb_plotters_bitmap_tile(x, y, width, height,
+ return fb_plotters_bitmap_tile(x, y, width, height,
bitmap, bg, repeat_x, repeat_y,
content, fb_16bpp_bitmap);
}
Modified: trunk/netsurf/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_32bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_32bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_32bpp_plotters.c Thu Feb 26 17:05:06 2009
@@ -33,16 +33,16 @@
static inline uint32_t *
fb_32bpp_get_xy_loc(int x, int y)
{
- return (uint32_t *)(framebuffer->ptr +
- (y * framebuffer->linelen) +
+ return (uint32_t *)(framebuffer->ptr +
+ (y * framebuffer->linelen) +
(x << 2));
}
#if __BYTE_ORDER == __BIG_ENDIAN
static inline colour fb_32bpp_to_colour(uint32_t pixel)
{
- return ((pixel & 0xFF00) >> 8) |
- ((pixel & 0xFF0000) >> 8) |
+ return ((pixel & 0xFF00) >> 8) |
+ ((pixel & 0xFF0000) >> 8) |
((pixel & 0xFF000000) >> 8);
}
@@ -54,8 +54,8 @@
#else
static inline colour fb_32bpp_to_colour(uint32_t pixel)
{
- return ((pixel & 0xFF) << 16) |
- ((pixel & 0xFF00)) |
+ return ((pixel & 0xFF) << 16) |
+ ((pixel & 0xFF00)) |
((pixel & 0xFF0000) >> 16);
}
@@ -121,7 +121,7 @@
x = dyabs >> 1;
y = dxabs >> 1;
- if (dxabs >= dyabs) {
+ if (dxabs >= dyabs) {
/* the line is more horizontal than vertical */
for (i = 0; i <= dxabs; i++) {
*pvideo = ent;
@@ -146,7 +146,7 @@
}
}
}
-
+
}
return true;
@@ -191,7 +191,7 @@
pvid = fb_32bpp_get_xy_loc(x0, y0);
while (height-- > 0) {
- for (w = width; w > 0; w--) *pvid++ = ent;
+ for (w = width; w > 0; w--) *pvid++ = ent;
pvid += llen;
}
@@ -200,10 +200,10 @@
static bool fb_32bpp_clg(colour c)
{
- fb_32bpp_fill(fb_plot_ctx.x0,
- fb_plot_ctx.y0,
- fb_plot_ctx.x1,
- fb_plot_ctx.y1,
+ fb_32bpp_fill(fb_plot_ctx.x0,
+ fb_plot_ctx.y0,
+ fb_plot_ctx.x1,
+ fb_plot_ctx.y1,
c);
return true;
}
@@ -234,7 +234,7 @@
y+=1; /* the coord is the bottom-left of the pixels offset by 1 to make
- * it work since fb coords are the top-left of pixels
+ * it work since fb coords are the top-left of pixels
*/
/* The part of the text displayed is cropped to the current context. */
@@ -267,16 +267,16 @@
if ((xloop % 8) == 0) {
row = *fntd++;
}
-
+
if ((row & 0x80) != 0) {
*(pvideo + xloop) = fgcol;
- }
+ }
row = row << 1;
}
pvideo += (framebuffer->linelen >> 2);
}
-
+
return true;
}
@@ -295,7 +295,7 @@
uint32_t fgcol;
/* The part of the scaled image actually displayed is cropped to the
- * current context.
+ * current context.
*/
x0 = x;
y0 = y;
@@ -325,7 +325,7 @@
if ((abpixel & 0xFF000000) != 0) {
/* pixel is not transparent */
if ((abpixel & 0xFF000000) != 0xFF000000) {
- abpixel = fb_plotters_ablend(abpixel,
+ abpixel = fb_plotters_ablend(abpixel,
fb_32bpp_to_colour(*(pvideo + xloop)));
}
@@ -351,23 +351,23 @@
nxtchr = utf8_next(text, length, nxtchr);
glyph = fb_getglyph(style, ucs4);
- if (glyph == NULL)
+ if (glyph == NULL)
continue;
if (glyph->format == FT_GLYPH_FORMAT_BITMAP) {
bglyph = (FT_BitmapGlyph)glyph;
- /* now, draw to our target surface */
+ /* now, draw to our target surface */
if (bglyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
- fb_32bpp_draw_ft_monobitmap(&bglyph->bitmap,
- x + bglyph->left,
+ fb_32bpp_draw_ft_monobitmap(&bglyph->bitmap,
+ x + bglyph->left,
y - bglyph->top,
- c);
+ c);
} else {
- fb_32bpp_draw_ft_bitmap(&bglyph->bitmap,
- x + bglyph->left,
+ fb_32bpp_draw_ft_bitmap(&bglyph->bitmap,
+ x + bglyph->left,
y - bglyph->top,
- c);
+ c);
}
}
x += glyph->advance.x >> 16;
@@ -395,7 +395,7 @@
/* aquire thge text in local font encoding */
utf8_to_font_encoding(fb_font, text, length, (char**)&buffer);
- if (!buffer)
+ if (!buffer)
return true;
length = strlen((char *)buffer);
@@ -404,7 +404,7 @@
y-=((fb_font->height * 75)/100);
y+=1; /* the coord is the bottom-left of the pixels offset by 1 to make
- * it work since fb coords are the top-left of pixels
+ * it work since fb coords are the top-left of pixels
*/
/* The part of the text displayed is cropped to the current context. */
@@ -434,7 +434,7 @@
if ((x + fb_font->width) > x1)
break;
- if (x < x0)
+ if (x < x0)
continue;
pvideo = fb_32bpp_get_xy_loc(x, y0);
@@ -478,7 +478,7 @@
static bool fb_32bpp_bitmap(int x, int y, int width, int height,
- struct bitmap *bitmap, colour bg,
+ struct bitmap *bitmap, colour bg,
struct content *content)
{
uint32_t *pvideo;
@@ -488,11 +488,11 @@
int x0,y0,x1,y1;
int xoff, yoff; /* x and y offset into image */
- /* LOG(("x %d, y %d, width %d, height %d, bitmap %p, content %p",
+ /* LOG(("x %d, y %d, width %d, height %d, bitmap %p, content %p",
x,y,width,height,bitmap,content));*/
/* TODO here we should scale the image from bitmap->width to width, for
- * now simply crop.
+ * now simply crop.
*/
if (width > bitmap->width)
width = bitmap->width;
@@ -501,7 +501,7 @@
height = bitmap->height;
/* The part of the scaled image actually displayed is cropped to the
- * current context.
+ * current context.
*/
x0 = x;
y0 = y;
@@ -518,17 +518,18 @@
width = (x1 - x0);
xoff = x0 - x;
- yoff = y0 - y;
+ yoff = (y0 - y) * bitmap->width;
+ height *= bitmap->width;
/* plot the image */
pvideo = fb_32bpp_get_xy_loc(x0, y0);
- for (yloop = 0; yloop < height; yloop++) {
+ for (yloop = yoff; yloop < height; yloop += bitmap->width) {
for (xloop = 0; xloop < width; xloop++) {
- abpixel = pixel[((yoff + yloop) * bitmap->width) + xloop + xoff];
+ abpixel = pixel[yloop + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
- abpixel = fb_plotters_ablend(abpixel,
+ abpixel = fb_plotters_ablend(abpixel,
fb_32bpp_to_colour(*(pvideo + xloop)));
}
@@ -544,10 +545,10 @@
static bool fb_32bpp_bitmap_tile(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
- bool repeat_x, bool repeat_y,
+ bool repeat_x, bool repeat_y,
struct content *content)
{
- return fb_plotters_bitmap_tile(x, y, width, height,
+ return fb_plotters_bitmap_tile(x, y, width, height,
bitmap, bg, repeat_x, repeat_y,
content, fb_32bpp_bitmap);
}
@@ -578,7 +579,7 @@
.arc = fb_32bpp_arc,
.bitmap = fb_32bpp_bitmap,
.bitmap_tile = fb_32bpp_bitmap_tile,
- .flush = fb_32bpp_flush,
+ .flush = fb_32bpp_flush,
.path = fb_32bpp_path,
.option_knockout = true,
};
14 years, 3 months
r6646 vince - /trunk/netsurf/framebuffer/fb_16bpp_plotters.c
by netsurf@semichrome.net
Author: vince
Date: Thu Feb 26 16:59:28 2009
New Revision: 6646
URL: http://source.netsurf-browser.org?rev=6646&view=rev
Log:
If its safe to do so do fills with words at a time
Modified:
trunk/netsurf/framebuffer/fb_16bpp_plotters.c
Modified: trunk/netsurf/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_16bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_16bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_16bpp_plotters.c Thu Feb 26 16:59:28 2009
@@ -166,8 +166,10 @@
static bool fb_16bpp_fill(int x0, int y0, int x1, int y1, colour c)
{
int w;
- uint16_t *pvid;
- uint16_t ent;
+ uint16_t *pvid16;
+ uint16_t ent16;
+ uint32_t *pvid32;
+ uint32_t ent32;
uint32_t llen;
uint32_t width;
uint32_t height;
@@ -175,18 +177,33 @@
if (!fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1))
return true; /* fill lies outside current clipping region */
- ent = fb_colour_to_pixel(c);
+ ent16 = fb_colour_to_pixel(c);
width = x1 - x0;
height = y1 - y0;
- llen = (framebuffer->linelen >> 1) - width;
-
- pvid = fb_16bpp_get_xy_loc(x0, y0);
-
- while (height-- > 0) {
- for (w = width; w > 0; w--) *pvid++ = ent;
- pvid += llen;
+
+ pvid16 = fb_16bpp_get_xy_loc(x0, y0);
+
+ if (((x0 & 1) == 0) && ((width & 1) == 0)) {
+ /* aligned to 32bit value and width is even */
+ width = width >> 1;
+ llen = (framebuffer->linelen >> 2) - width;
+ ent32 = ent16 | (ent16 << 16);
+ pvid32 = (uint32_t *)pvid16;
+
+ while (height-- > 0) {
+ for (w = width; w > 0; w--) *pvid32++ = ent32;
+ pvid32 += llen;
+ }
+
+ } else {
+ llen = (framebuffer->linelen >> 1) - width;
+
+
+ while (height-- > 0) {
+ for (w = width; w > 0; w--) *pvid16++ = ent16;
+ pvid16 += llen;
+ }
}
-
return true;
}
14 years, 3 months
r6645 vince - /trunk/netsurf/framebuffer/fb_plotters.c
by netsurf@semichrome.net
Author: vince
Date: Thu Feb 26 16:08:12 2009
New Revision: 6645
URL: http://source.netsurf-browser.org?rev=6645&view=rev
Log:
use restrict keywords to improve rectangle clipping perfomance
Modified:
trunk/netsurf/framebuffer/fb_plotters.c
Modified: trunk/netsurf/framebuffer/fb_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_plotters.c...
==============================================================================
--- trunk/netsurf/framebuffer/fb_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_plotters.c Thu Feb 26 16:08:12 2009
@@ -55,8 +55,8 @@
#define SWAP(a, b) do { int t; t=(a); (a)=(b); (b)=t; } while(0)
/* clip a rectangle to another rectangle */
-bool fb_plotters_clip_rect(const bbox_t *clip,
- int *x0, int *y0, int *x1, int *y1)
+bool fb_plotters_clip_rect(const bbox_t * restrict clip,
+ int * restrict x0, int * restrict y0, int * restrict x1, int * restrict y1)
{
char region1;
char region2;
14 years, 3 months
r6644 vince - in /trunk/netsurf/framebuffer: fb_16bpp_plotters.c fb_32bpp_plotters.c fb_plotters.c fb_plotters.h
by netsurf@semichrome.net
Author: vince
Date: Thu Feb 26 15:37:22 2009
New Revision: 6644
URL: http://source.netsurf-browser.org?rev=6644&view=rev
Log:
try and improve plotter perfomance futher
Modified:
trunk/netsurf/framebuffer/fb_16bpp_plotters.c
trunk/netsurf/framebuffer/fb_32bpp_plotters.c
trunk/netsurf/framebuffer/fb_plotters.c
trunk/netsurf/framebuffer/fb_plotters.h
Modified: trunk/netsurf/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_16bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_16bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_16bpp_plotters.c Thu Feb 26 15:37:22 2009
@@ -45,6 +45,12 @@
((pixel & 0xF800) >> 8);
}
+/* convert a colour value to a 16bpp pixel value ready for screen output */
+static inline uint16_t fb_colour_to_pixel(colour c)
+{
+ return ((c & 0xF8) << 8) | ((c & 0xFC00 ) >> 5) | ((c & 0xF80000) >> 19);
+}
+
#define SIGN(x) ((x<0) ? -1 : ((x>0) ? 1 : 0))
static bool fb_16bpp_line(int x0, int y0, int x1, int y1, int width,
@@ -66,9 +72,7 @@
if (y0 < fb_plot_ctx.y0)
return true;
- ent = ((c & 0xF8) << 8) |
- ((c & 0xFC00 ) >> 5) |
- ((c & 0xF80000) >> 19);
+ ent = fb_colour_to_pixel(c);
if (y0 == y1) {
/* horizontal line special cased */
@@ -162,25 +166,25 @@
static bool fb_16bpp_fill(int x0, int y0, int x1, int y1, colour c)
{
int w;
- int y;
+ uint16_t *pvid;
uint16_t ent;
- uint16_t *pvideo;
+ uint32_t llen;
+ uint32_t width;
+ uint32_t height;
if (!fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1))
return true; /* fill lies outside current clipping region */
- ent = ((c & 0xF8) << 8) |
- ((c & 0xFC00 ) >> 5) |
- ((c & 0xF80000) >> 19);
-
- pvideo = fb_16bpp_get_xy_loc(x0, y0);
-
- for (y = y0; y < y1; y++) {
- w = x1 - x0;
- while (w-- > 0) {
- *(pvideo + w) = ent;
- }
- pvideo += (framebuffer->linelen >> 1);
+ ent = fb_colour_to_pixel(c);
+ width = x1 - x0;
+ height = y1 - y0;
+ llen = (framebuffer->linelen >> 1) - width;
+
+ pvid = fb_16bpp_get_xy_loc(x0, y0);
+
+ while (height-- > 0) {
+ for (w = width; w > 0; w--) *pvid++ = ent;
+ pvid += llen;
}
return true;
@@ -252,10 +256,7 @@
fb_16bpp_to_colour(*(pvideo + xloop)));
}
- *(pvideo + xloop) =
- ((abpixel & 0xF8) << 8) |
- ((abpixel & 0xFC00 ) >> 5) |
- ((abpixel & 0xF80000) >> 19);
+ *(pvideo + xloop) = fb_colour_to_pixel(abpixel);
}
}
@@ -351,14 +352,9 @@
xoff = x0 - x;
yoff = y0 - y;
- fgcol = ((c & 0xF8) << 8) |
- ((c & 0xFC00 ) >> 5) |
- ((c & 0xF80000) >> 19);
-
- bgcol = ((bg & 0xF8) << 8) |
- ((bg & 0xFC00 ) >> 5) |
- ((bg & 0xF80000) >> 19);
-
+ fgcol = fb_colour_to_pixel(c);
+
+ bgcol = fb_colour_to_pixel(bg);
/*LOG(("x %d, y %d, style %p, txt %.*s , len %d, bg 0x%lx, fg 0x%lx",
x,y,style,length,text,length,bg,c));*/
@@ -463,11 +459,7 @@
fb_16bpp_to_colour(*(pvideo + xloop)));
}
- *(pvideo + xloop) =
- ((abpixel & 0xF8) << 8) |
- ((abpixel & 0xFC00 ) >> 5) |
- ((abpixel & 0xF80000) >> 19);
-
+ *(pvideo + xloop) = fb_colour_to_pixel(abpixel);
}
}
pvideo += (framebuffer->linelen >> 1);
Modified: trunk/netsurf/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_32bpp_plot...
==============================================================================
--- trunk/netsurf/framebuffer/fb_32bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_32bpp_plotters.c Thu Feb 26 15:37:22 2009
@@ -174,7 +174,6 @@
static bool fb_32bpp_fill(int x0, int y0, int x1, int y1, colour c)
{
int w;
- uint32_t *pvid_line;
uint32_t *pvid;
uint32_t ent;
uint32_t llen;
@@ -185,18 +184,15 @@
return true; /* fill lies outside current clipping region */
ent = fb_colour_to_pixel(c);
- llen = (framebuffer->linelen >> 2);
width = x1 - x0;
height = y1 - y0;
-
- pvid_line = fb_32bpp_get_xy_loc(x0, y0);
-
- while (height > 0) {
- height--;
- pvid = pvid_line;
- pvid_line += llen;
- w = width;
- while (w-- > 0) *pvid++ = ent;
+ llen = (framebuffer->linelen >> 2) - width;
+
+ pvid = fb_32bpp_get_xy_loc(x0, y0);
+
+ while (height-- > 0) {
+ for (w = width; w > 0; w--) *pvid++ = ent;
+ pvid += llen;
}
return true;
Modified: trunk/netsurf/framebuffer/fb_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_plotters.c...
==============================================================================
--- trunk/netsurf/framebuffer/fb_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_plotters.c Thu Feb 26 15:37:22 2009
@@ -210,23 +210,6 @@
return true;
}
-colour fb_plotters_ablend(colour pixel, colour scrpixel)
-{
- int opacity = (pixel >> 24) & 0xFF;
- int r,g,b;
-
- r = (((pixel & 0xFF) * opacity) >> 8) +
- (((scrpixel & 0xFF) * (0xFF - opacity)) >> 8);
-
- g = ((((pixel & 0xFF00) >> 8) * opacity) >> 8) +
- ((((scrpixel & 0xFF00) >> 8) * (0xFF - opacity)) >> 8);
-
- b = ((((pixel & 0xFF0000) >> 16) * opacity) >> 8) +
- ((((scrpixel & 0xFF0000) >> 16) * (0xFF - opacity)) >> 8);
-
- return r | (g << 8) | (b << 16);
-}
-
typedef bool (linefn_t)(int x0, int y0, int x1, int y1, int width, colour c, bool dotted, bool dashed);
typedef struct dcPt_s {
Modified: trunk/netsurf/framebuffer/fb_plotters.h
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_plotters.h...
==============================================================================
--- trunk/netsurf/framebuffer/fb_plotters.h (original)
+++ trunk/netsurf/framebuffer/fb_plotters.h Thu Feb 26 15:37:22 2009
@@ -47,7 +47,24 @@
colour bg,
struct content *content));
-colour fb_plotters_ablend(colour pixel, colour scrpixel);
+/* alpha blend two pixels together */
+static inline colour fb_plotters_ablend(colour pixel, colour scrpixel)
+{
+ int opacity = (pixel >> 24) & 0xFF;
+ int r,g,b;
+
+ r = (((pixel & 0xFF) * opacity) >> 8) +
+ (((scrpixel & 0xFF) * (0xFF - opacity)) >> 8);
+
+ g = ((((pixel & 0xFF00) >> 8) * opacity) >> 8) +
+ ((((scrpixel & 0xFF00) >> 8) * (0xFF - opacity)) >> 8);
+
+ b = ((((pixel & 0xFF0000) >> 16) * opacity) >> 8) +
+ ((((scrpixel & 0xFF0000) >> 16) * (0xFF - opacity)) >> 8);
+
+ return r | (g << 8) | (b << 16);
+}
+
bool fb_plotters_move_block(int srcx, int srcy, int width, int height, int dstx, int dsty);
14 years, 3 months
r6643 tlsa - in /trunk/netsurf/framebuffer/res/icons: back_g.png forward_g.png home_g.png reload_g.png stop_g.png
by netsurf@semichrome.net
Author: tlsa
Date: Thu Feb 26 13:52:54 2009
New Revision: 6643
URL: http://source.netsurf-browser.org?rev=6643&view=rev
Log:
Greyed out toolbar icons.
Added:
trunk/netsurf/framebuffer/res/icons/back_g.png (with props)
trunk/netsurf/framebuffer/res/icons/forward_g.png (with props)
trunk/netsurf/framebuffer/res/icons/home_g.png (with props)
trunk/netsurf/framebuffer/res/icons/reload_g.png (with props)
trunk/netsurf/framebuffer/res/icons/stop_g.png (with props)
Added: trunk/netsurf/framebuffer/res/icons/back_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/res/icons/bac...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/framebuffer/res/icons/back_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/framebuffer/res/icons/forward_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/res/icons/for...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/framebuffer/res/icons/forward_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/framebuffer/res/icons/home_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/res/icons/hom...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/framebuffer/res/icons/home_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/framebuffer/res/icons/reload_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/res/icons/rel...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/framebuffer/res/icons/reload_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/framebuffer/res/icons/stop_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/res/icons/sto...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/framebuffer/res/icons/stop_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
14 years, 3 months
r6642 vince - /trunk/netsurf/Docs/BUILDING-Framebuffer
by netsurf@semichrome.net
Author: vince
Date: Thu Feb 26 13:32:03 2009
New Revision: 6642
URL: http://source.netsurf-browser.org?rev=6642&view=rev
Log:
add some notes on the different frontends
Modified:
trunk/netsurf/Docs/BUILDING-Framebuffer
Modified: trunk/netsurf/Docs/BUILDING-Framebuffer
URL: http://source.netsurf-browser.org/trunk/netsurf/Docs/BUILDING-Framebuffer...
==============================================================================
--- trunk/netsurf/Docs/BUILDING-Framebuffer (original)
+++ trunk/netsurf/Docs/BUILDING-Framebuffer Thu Feb 26 13:32:03 2009
@@ -44,6 +44,46 @@
sets up some environment variables which enable NetSurf to find its
resources.
+ Selecting a frontend and appropriate options
+==============================================
+
+ The framebuffer port can operate on a number of frontends. A
+ frontend in this context is simply the combination of input and
+ output devices. A frontend output device may be any linearly mapped
+ area of memory. The framebuffer may be treated as values at 32, 16
+ or 8 bits per pixel. The input device is typically selected to
+ complement the output device and is completely specific to the
+ frontend.
+
+ There are several configuration options which may influence the
+ framebuffer frontends. These are:
+
+ fb_refresh - The refresh rate (for physical displays)
+ fb_depth - The depth (in bits per pixel) of the framebuffer
+ window_width - The width of the framebuffer
+ window_height - The height of the framebuffer
+
+ The defaults are for 800 by 600 pixels at 16bpp and 70Hz refresh rate.
+
+ There are currently four frontends:
+
+ linux Output to a Linux framebuffer and input from linux input
+ event device nodes. The output device is specified with
+ the fb_device option which defaults to /dev/fb0 . The
+ input nodes are searched for in the path specified by the
+ fb_input_devpath option which defaults to /dev/input/
+
+ sdl The SDL frontend is a straightforward port to the SDL library
+ which abstracts the input and output from the application and has
+ been targeted to several operating systems.
+
+ vnc The VNC server frontend uses the libvncserver library to
+ provide a straightforward unsecured VNC server, multiple
+ clients may connect.
+
+ able Output to the Simtec ABLE bootloader framebuffer and input
+ from its input device node.
+
Obtaining NetSurf's build dependencies
========================================
14 years, 3 months
r6641 vince - in /trunk/netsurf/framebuffer: fb_frontend_linuxfb.c fb_frontend_sdl.c fb_frontend_vnc.c fb_options.h
by netsurf@semichrome.net
Author: vince
Date: Thu Feb 26 12:58:03 2009
New Revision: 6641
URL: http://source.netsurf-browser.org?rev=6641&view=rev
Log:
Improve option handling code in frontends
Improve depth handling in the VNC frontend
Modified:
trunk/netsurf/framebuffer/fb_frontend_linuxfb.c
trunk/netsurf/framebuffer/fb_frontend_sdl.c
trunk/netsurf/framebuffer/fb_frontend_vnc.c
trunk/netsurf/framebuffer/fb_options.h
Modified: trunk/netsurf/framebuffer/fb_frontend_linuxfb.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_frontend_l...
==============================================================================
--- trunk/netsurf/framebuffer/fb_frontend_linuxfb.c (original)
+++ trunk/netsurf/framebuffer/fb_frontend_linuxfb.c Thu Feb 26 12:58:03 2009
@@ -135,12 +135,12 @@
fb_input_dev *d;
struct dirent *de;
const char *basepath = option_fb_input_devpath ? option_fb_input_devpath : "/dev/input";
-
+
dir = opendir(basepath);
-
+
if (dir == NULL)
return;
-
+
while ((de = readdir(dir)) != NULL) {
if (fnmatch(option_fb_input_glob ? option_fb_input_glob : "event*",
de->d_name, 0) == 0) {
@@ -154,7 +154,7 @@
}
}
}
-
+
closedir(dir);
}
@@ -185,7 +185,7 @@
sigemptyset(&act.sa_mask);
sigaction(SIGUSR1,&act,&old);
sigaction(SIGUSR2,&act,&old);
-
+
if (-1 == ioctl(tty,VT_GETMODE, &vt_mode)) {
perror("ioctl VT_GETMODE");
exit(1);
@@ -194,7 +194,7 @@
vt_mode.waitv = 0;
vt_mode.relsig = SIGUSR1;
vt_mode.acqsig = SIGUSR2;
-
+
if (-1 == ioctl(tty,VT_SETMODE, &vt_mode)) {
perror("ioctl VT_SETMODE");
exit(1);
@@ -210,7 +210,7 @@
{
#if 1 /* defined(__powerpc__) */
unsigned int i, *p;
-
+
i = (c & 0xff) << 8;
i |= i << 16;
len >>= 2;
@@ -227,13 +227,13 @@
FILE *fp;
char line[80],label[32],value[16];
int geometry=0, timings=0;
-
+
/* load current values */
if (ioctl(fb,FBIOGET_VSCREENINFO,&fb_var) == -1) {
perror("ioctl FBIOGET_VSCREENINFO");
exit(1);
}
-
+
if (name == NULL)
return -1;
if ((fp = fopen("/etc/fb.modes","r")) == NULL)
@@ -304,7 +304,7 @@
{
struct vt_stat vts;
char vtname[12];
-
+
if (vtno < 0) {
if (-1 == ioctl(tty,VT_OPENQRY, &vtno) || vtno == -1) {
perror("ioctl VT_OPENQRY");
@@ -354,11 +354,11 @@
}
/* Hmm. radeonfb needs this. matroxfb doesn't. */
-static int
+static int
fb_activate_current(int tty)
{
struct vt_stat vts;
-
+
if (-1 == ioctl(tty,VT_GETSTATE, &vts)) {
perror("ioctl VT_GETSTATE");
return -1;
@@ -402,11 +402,14 @@
}
static int
-fb_init(const char *device, const char *mode, int bpp, int vt)
+framebuffer_init(const char *device, int width, int height, int refresh, int bpp, int vt)
{
char fbdev[16];
struct vt_stat vts;
long pm = ~(sysconf(_SC_PAGESIZE) - 1);
+ char mode[32];
+
+ snprintf(mode, 32, "%dx%d-%d", width, height, refresh);
dev_init();
tty = 0;
@@ -418,7 +421,7 @@
strerror(errno));
exit(1);
}
-
+
if (device == NULL) {
device = getenv("FRAMEBUFFER");
if (device == NULL) {
@@ -469,10 +472,10 @@
exit(1);
}
tcgetattr(tty, &term);
-
+
/* switch mode */
fb_setmode(mode, bpp);
-
+
/* checks & initialisation */
if (-1 == ioctl(fb,FBIOGET_FSCREENINFO,&fb_fix)) {
perror("ioctl FBIOGET_FSCREENINFO");
@@ -559,8 +562,30 @@
{
framebuffer_t *newfb;
int ploop;
-
- fb_init(option_fb_device, option_fb_mode ? option_fb_mode : "800x600-70", 16, 1);
+ int fb_width;
+ int fb_height;
+ int fb_refresh;
+ int fb_depth;
+
+ if ((option_window_width != 0) && (option_window_height != 0)) {
+ fb_width = option_window_width;
+ fb_height = option_window_height;
+ } else {
+ fb_width = 800;
+ fb_height = 600;
+ }
+
+ if (option_fb_refresh != 0) {
+ fb_refresh = option_fb_refresh;
+ } else {
+ fb_refresh = 60;
+ }
+
+ fb_depth = option_fb_depth;
+ if ((fb_depth != 32) && (fb_depth != 16) && (fb_depth != 8))
+ fb_depth = 16; /* sanity checked depth in bpp */
+
+ framebuffer_init(option_fb_device, fb_width, fb_height, fb_refresh, fb_depth, 1);
fb_switch_init();
fb_catch_exit_signals();
@@ -574,16 +599,16 @@
if (newfb->bpp <= 8) {
for(ploop=0; ploop < 256; ploop++) {
- newfb->palette[ploop] = 0xFF000000 |
- ocmap.blue[ploop] << 16 |
- ocmap.green[ploop] << 8 |
- ocmap.red[ploop] ;
+ newfb->palette[ploop] = 0xFF000000 |
+ ocmap.blue[ploop] << 16 |
+ ocmap.green[ploop] << 8 |
+ ocmap.red[ploop] ;
}
}
fb_open_input_devices();
-
+
return newfb;
}
@@ -594,50 +619,50 @@
static int keymap[] = {
- -1, -1, '1', '2', '3', '4', '5', '6', '7', '8', /* 0 - 9 */
- '9', '0', '-', '=', 8, 9, 'q', 'w', 'e', 'r', /* 10 - 19 */
- 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 13, -1, /* 20 - 29 */
- 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', /* 30 - 39 */
+ -1, -1, '1', '2', '3', '4', '5', '6', '7', '8', /* 0 - 9 */
+ '9', '0', '-', '=', 8, 9, 'q', 'w', 'e', 'r', /* 10 - 19 */
+ 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 13, -1, /* 20 - 29 */
+ 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', /* 30 - 39 */
'\'', '#', -1, '\\', 'z', 'x', 'c', 'v', 'b', 'n', /* 40 - 49 */
- 'm', ',', '.', '/', -1, -1, -1, ' ', -1, -1, /* 50 - 59 */
+ 'm', ',', '.', '/', -1, -1, -1, ' ', -1, -1, /* 50 - 59 */
};
static int sh_keymap[] = {
- -1, -1, '!', '"', '£', '$', '%', '^', '&', '*', /* 0 - 9 */
- '(', ')', '_', '+', 8, 9, 'Q', 'W', 'E', 'R', /* 10 - 19 */
- 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', 13, -1, /* 20 - 29 */
- 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* 30 - 39 */
- '@', '~', -1, '|', 'Z', 'X', 'C', 'V', 'B', 'N', /* 40 - 49 */
- 'M', '<', '>', '?', -1, -1, -1, ' ', -1, -1, /* 50 - 59 */
+ -1, -1, '!', '"', 0xa3, '$', '%', '^', '&', '*', /* 0 - 9 */
+ '(', ')', '_', '+', 8, 9, 'Q', 'W', 'E', 'R', /* 10 - 19 */
+ 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', 13, -1, /* 20 - 29 */
+ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* 30 - 39 */
+ '@', '~', -1, '|', 'Z', 'X', 'C', 'V', 'B', 'N', /* 40 - 49 */
+ 'M', '<', '>', '?', -1, -1, -1, ' ', -1, -1, /* 50 - 59 */
};
/* performs character mapping */
-static int keycode_to_ascii(int code, bool shift)
-{
- int ascii = -1;
+static int keycode_to_ucs4(int code, bool shift)
+{
+ int ucs4 = -1;
if (shift) {
if ((code >= 0) && (code < sizeof(sh_keymap)))
- ascii = sh_keymap[code];
+ ucs4 = sh_keymap[code];
} else {
if ((code >= 0) && (code < sizeof(keymap)))
- ascii = keymap[code];
- }
- return ascii;
-}
-
-void fb_os_input(struct gui_window *g, bool active)
+ ucs4 = keymap[code];
+ }
+ return ucs4;
+}
+
+void fb_os_input(struct gui_window *g, bool active)
{
ssize_t amt;
- struct input_event event;
+ struct input_event event;
fb_input_dev *d;
- int ascii = -1;
+ int ucs4 = -1;
static bool shift = false;
for (d = inputdevs; d != NULL; d = d->next) {
amt = read(d->fd, &event, sizeof(struct input_event));
-
+
if (amt > 0) {
if (event.type == EV_KEY) {
if (event.value == 0) {
@@ -649,20 +674,20 @@
break;
case BTN_LEFT:
- fb_rootwindow_click(g,
- BROWSER_MOUSE_CLICK_1,
- fb_cursor_x(framebuffer),
+ fb_rootwindow_click(g,
+ BROWSER_MOUSE_CLICK_1,
+ fb_cursor_x(framebuffer),
fb_cursor_y(framebuffer));
break;
}
return;
}
-
+
switch (event.code) {
case KEY_PAGEDOWN:
fb_window_scroll(g, 0, g->height);
break;
-
+
case KEY_PAGEUP:
fb_window_scroll(g, 0, -g->height);
break;
@@ -670,7 +695,7 @@
case KEY_DOWN:
fb_window_scroll(g, 0, 100);
break;
-
+
case KEY_UP:
fb_window_scroll(g, 0, -100);
break;
@@ -678,19 +703,19 @@
case KEY_LEFT:
fb_window_scroll(g, -100, 0);
break;
-
+
case KEY_RIGHT:
fb_window_scroll(g, 100, 0);
break;
-
+
case KEY_ESC:
browser_window_destroy(g->bw);
break;
case BTN_LEFT:
- fb_rootwindow_click(g,
- BROWSER_MOUSE_PRESS_1,
- fb_cursor_x(framebuffer),
+ fb_rootwindow_click(g,
+ BROWSER_MOUSE_PRESS_1,
+ fb_cursor_x(framebuffer),
fb_cursor_y(framebuffer));
break;
@@ -700,7 +725,7 @@
break;
default:
- ascii = keycode_to_ascii(event.code, shift);
+ ucs4 = keycode_to_ucs4(event.code, shift);
}
} else if (event.type == EV_REL) {
@@ -709,7 +734,7 @@
fb_rootwindow_move(framebuffer, g, event.value, 0, true);
break;
- case 1:
+ case 1:
fb_rootwindow_move(framebuffer, g, 0, event.value, true);
break;
@@ -719,12 +744,12 @@
}
}
- if (ascii != -1) {
- fb_rootwindow_input(g, ascii);
- ascii = -1;
+ if (ucs4 != -1) {
+ fb_rootwindow_input(g, ucs4);
+ ucs4 = -1;
}
-
+
}
}
}
@@ -745,4 +770,3 @@
* c-basic-offset:8
* End:
*/
-
Modified: trunk/netsurf/framebuffer/fb_frontend_sdl.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_frontend_s...
==============================================================================
--- trunk/netsurf/framebuffer/fb_frontend_sdl.c (original)
+++ trunk/netsurf/framebuffer/fb_frontend_sdl.c Thu Feb 26 12:58:03 2009
@@ -37,6 +37,7 @@
#include "framebuffer/fb_frontend.h"
#include "framebuffer/fb_cursor.h"
#include "framebuffer/fb_rootwindow.h"
+#include "framebuffer/fb_options.h"
#include "utils/log.h"
@@ -47,6 +48,21 @@
framebuffer_t *fb_os_init(int argc, char** argv)
{
framebuffer_t *newfb;
+ int fb_width;
+ int fb_height;
+ int fb_depth;
+
+ if ((option_window_width != 0) && (option_window_height != 0)) {
+ fb_width = option_window_width;
+ fb_height = option_window_height;
+ } else {
+ fb_width = 800;
+ fb_height = 600;
+ }
+
+ fb_depth = option_fb_depth;
+ if ((fb_depth != 32) && (fb_depth != 16) && (fb_depth != 8))
+ fb_depth = 16; /* sanity checked depth in bpp */
newfb = calloc(1, sizeof(framebuffer_t));
if (newfb == NULL)
@@ -58,9 +74,9 @@
}
atexit(SDL_Quit);
- newfb->width = 800;
- newfb->height = 600;
- newfb->bpp = 32;
+ newfb->width = fb_width;
+ newfb->height = fb_height;
+ newfb->bpp = fb_depth;
sdl_screen = SDL_SetVideoMode(newfb->width,
newfb->height,
Modified: trunk/netsurf/framebuffer/fb_frontend_vnc.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_frontend_v...
==============================================================================
--- trunk/netsurf/framebuffer/fb_frontend_vnc.c (original)
+++ trunk/netsurf/framebuffer/fb_frontend_vnc.c Thu Feb 26 12:58:03 2009
@@ -38,6 +38,7 @@
#include "framebuffer/fb_frontend.h"
#include "framebuffer/fb_cursor.h"
#include "framebuffer/fb_rootwindow.h"
+#include "framebuffer/fb_options.h"
#include "utils/log.h"
@@ -48,30 +49,30 @@
{
struct gui_window *g = cur_window;
if (buttonMask == 0) {
- fb_rootwindow_move(framebuffer, g, x, y, false);
+ fb_rootwindow_move(framebuffer, g, x, y, false);
} else {
/* left button */
/* if (buttonMask && 0x1) {
- fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_1,
- fb_cursor_x(framebuffer),
- fb_cursor_y(framebuffer));
- }*/
+ fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_1,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ }*/
if (buttonMask && 0x1) {
- fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_1,
- fb_cursor_x(framebuffer),
+ fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_1,
+ fb_cursor_x(framebuffer),
fb_cursor_y(framebuffer));
}
/* right button */
/*if (buttonMask && 0x4) {
- fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_2,
- fb_cursor_x(framebuffer),
- fb_cursor_y(framebuffer));
- }*/
+ fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_2,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ }*/
if (buttonMask && 0x4) {
- fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_2,
- fb_cursor_x(framebuffer),
+ fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_2,
+ fb_cursor_x(framebuffer),
fb_cursor_y(framebuffer));
}
@@ -85,30 +86,30 @@
fb_window_scroll(g, 0, 100);
}
-
+
/*
- case SDL_MOUSEBUTTONUP:
- switch (event.button.button) {
-
- case SDL_BUTTON_LEFT:
- fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_1,
- fb_cursor_x(framebuffer),
- fb_cursor_y(framebuffer));
- break;
-
- case SDL_BUTTON_RIGHT:
- fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_2,
- fb_cursor_x(framebuffer),
- fb_cursor_y(framebuffer));
- break;
-
- default:
- printf("Mouse button %d pressed at (%d,%d)\n",
- event.button.button, event.button.x, event.button.y);
-
- }
- break;
+ case SDL_MOUSEBUTTONUP:
+ switch (event.button.button) {
+
+ case SDL_BUTTON_LEFT:
+ fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_1,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ break;
+
+ case SDL_BUTTON_RIGHT:
+ fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_2,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ break;
+
+ default:
+ printf("Mouse button %d pressed at (%d,%d)\n",
+ event.button.button, event.button.x, event.button.y);
+
+ }
+ break;
*/
}
}
@@ -124,7 +125,7 @@
case XK_Page_Down:
fb_window_scroll(g, 0, g->height);
break;
-
+
case XK_Page_Up:
fb_window_scroll(g, 0, -g->height);
break;
@@ -132,11 +133,11 @@
case XK_Down:
fb_window_scroll(g, 0, 100);
break;
-
+
case XK_Up:
fb_window_scroll(g, 0, -100);
break;
-
+
case XK_Escape:
browser_window_destroy(g->bw);
break;
@@ -161,34 +162,66 @@
framebuffer_t *fb_os_init(int argc, char** argv)
{
framebuffer_t *newfb;
+ int fb_width;
+ int fb_height;
+ int fb_depth;
+
+ if ((option_window_width != 0) && (option_window_height != 0)) {
+ fb_width = option_window_width;
+ fb_height = option_window_height;
+ } else {
+ fb_width = 800;
+ fb_height = 600;
+ }
+
+ fb_depth = option_fb_depth;
+ if ((fb_depth != 32) && (fb_depth != 16) && (fb_depth != 8))
+ fb_depth = 16; /* sanity checked depth in bpp */
newfb = calloc(1, sizeof(framebuffer_t));
if (newfb == NULL)
return NULL;
- newfb->width = 800;
- newfb->height = 600;
- newfb->bpp = 32;
-
- vnc_screen = rfbGetScreen(&argc, argv,
- newfb->width, newfb->height,
- 8, 3, 4);
-
- vnc_screen->frameBuffer = malloc(newfb->width * newfb->height * 4);
-
- vnc_screen->serverFormat.trueColour=TRUE;
- vnc_screen->serverFormat.redShift = 16;
- vnc_screen->serverFormat.greenShift = 8;
- vnc_screen->serverFormat.blueShift = 0;
+ newfb->width = fb_width;
+ newfb->height = fb_height;
+ newfb->bpp = fb_depth;
+
+ vnc_screen = rfbGetScreen(&argc, argv,
+ newfb->width, newfb->height,
+ 8, 3, (fb_depth / 8));
+
+ vnc_screen->frameBuffer = malloc(newfb->width * newfb->height * (fb_depth / 8));
+
+ switch (fb_depth) {
+ case 8:
+ break;
+
+ case 16:
+ vnc_screen->serverFormat.trueColour=TRUE;
+ vnc_screen->serverFormat.redShift = 11;
+ vnc_screen->serverFormat.greenShift = 5;
+ vnc_screen->serverFormat.blueShift = 0;
+ vnc_screen->serverFormat.redMax = 31;
+ vnc_screen->serverFormat.greenMax = 63;
+ vnc_screen->serverFormat.blueMax = 31;
+ break;
+
+ case 32:
+ vnc_screen->serverFormat.trueColour=TRUE;
+ vnc_screen->serverFormat.redShift = 16;
+ vnc_screen->serverFormat.greenShift = 8;
+ vnc_screen->serverFormat.blueShift = 0;
+ break;
+ }
vnc_screen->alwaysShared = TRUE;
- vnc_screen->ptrAddEvent = fb_vnc_doptr;
+ vnc_screen->ptrAddEvent = fb_vnc_doptr;
vnc_screen->kbdAddEvent = fb_vnc_dokey;
rfbInitServer(vnc_screen);
newfb->ptr = vnc_screen->frameBuffer;
- newfb->linelen = newfb->width * 4;
+ newfb->linelen = newfb->width * (fb_depth / 8);
//rfbUndrawCursor(vnc_screen);
@@ -199,7 +232,7 @@
{
}
-void fb_os_input(struct gui_window *g, bool active)
+void fb_os_input(struct gui_window *g, bool active)
{
//SDL_Event event;
cur_window = g;
@@ -209,109 +242,109 @@
else
rfbProcessEvents(vnc_screen, 100000);
/*
- switch (event.type) {
- case SDL_KEYDOWN:
-
- switch (event.key.keysym.sym) {
-
- case SDLK_PAGEDOWN:
- fb_window_scroll(g, 0, g->height);
- break;
-
- case SDLK_PAGEUP:
- fb_window_scroll(g, 0, -g->height);
- break;
-
- case SDLK_DOWN:
- fb_window_scroll(g, 0, 100);
- break;
-
- case SDLK_UP:
- fb_window_scroll(g, 0, -100);
- break;
-
- case SDLK_ESCAPE:
- browser_window_destroy(g->bw);
- break;
-
- case SDLK_LEFT:
- if (history_back_available(g->bw->history))
- history_back(g->bw, g->bw->history);
- break;
-
- case SDLK_RIGHT:
- if (history_forward_available(g->bw->history))
- history_forward(g->bw, g->bw->history);
- break;
-
- default:
- printf("The %s key was pressed!\n",
- SDL_GetKeyName(event.key.keysym.sym));
- fb_rootwindow_input(g, event.key.keysym.sym);
- break;
- }
- break;
-
- case SDL_MOUSEMOTION:
- fb_rootwindow_move(framebuffer, g, event.motion.x, event.motion.y, false);
- break;
-
- case SDL_MOUSEBUTTONDOWN:
- switch (event.button.button) {
-
- case SDL_BUTTON_LEFT:
- fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_1,
- fb_cursor_x(framebuffer),
- fb_cursor_y(framebuffer));
- break;
-
- case SDL_BUTTON_RIGHT:
- fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_2,
- fb_cursor_x(framebuffer),
- fb_cursor_y(framebuffer));
- break;
-
- case SDL_BUTTON_WHEELUP:
- fb_window_scroll(g, 0, -100);
- break;
-
- case SDL_BUTTON_WHEELDOWN:
- fb_window_scroll(g, 0, 100);
- break;
-
- case SDL_BUTTON_MIDDLE:
- default:
- printf("Mouse button %d pressed at (%d,%d)\n",
- event.button.button, event.button.x, event.button.y);
-
- }
- break;
-
- case SDL_MOUSEBUTTONUP:
- switch (event.button.button) {
-
- case SDL_BUTTON_LEFT:
- fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_1,
- fb_cursor_x(framebuffer),
- fb_cursor_y(framebuffer));
- break;
-
- case SDL_BUTTON_RIGHT:
- fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_2,
- fb_cursor_x(framebuffer),
- fb_cursor_y(framebuffer));
- break;
-
- default:
- printf("Mouse button %d pressed at (%d,%d)\n",
- event.button.button, event.button.x, event.button.y);
-
- }
- break;
-
- case SDL_QUIT:
- browser_window_destroy(g->bw);
- }
+ switch (event.type) {
+ case SDL_KEYDOWN:
+
+ switch (event.key.keysym.sym) {
+
+ case SDLK_PAGEDOWN:
+ fb_window_scroll(g, 0, g->height);
+ break;
+
+ case SDLK_PAGEUP:
+ fb_window_scroll(g, 0, -g->height);
+ break;
+
+ case SDLK_DOWN:
+ fb_window_scroll(g, 0, 100);
+ break;
+
+ case SDLK_UP:
+ fb_window_scroll(g, 0, -100);
+ break;
+
+ case SDLK_ESCAPE:
+ browser_window_destroy(g->bw);
+ break;
+
+ case SDLK_LEFT:
+ if (history_back_available(g->bw->history))
+ history_back(g->bw, g->bw->history);
+ break;
+
+ case SDLK_RIGHT:
+ if (history_forward_available(g->bw->history))
+ history_forward(g->bw, g->bw->history);
+ break;
+
+ default:
+ printf("The %s key was pressed!\n",
+ SDL_GetKeyName(event.key.keysym.sym));
+ fb_rootwindow_input(g, event.key.keysym.sym);
+ break;
+ }
+ break;
+
+ case SDL_MOUSEMOTION:
+ fb_rootwindow_move(framebuffer, g, event.motion.x, event.motion.y, false);
+ break;
+
+ case SDL_MOUSEBUTTONDOWN:
+ switch (event.button.button) {
+
+ case SDL_BUTTON_LEFT:
+ fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_1,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ break;
+
+ case SDL_BUTTON_RIGHT:
+ fb_rootwindow_click(g, BROWSER_MOUSE_PRESS_2,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ break;
+
+ case SDL_BUTTON_WHEELUP:
+ fb_window_scroll(g, 0, -100);
+ break;
+
+ case SDL_BUTTON_WHEELDOWN:
+ fb_window_scroll(g, 0, 100);
+ break;
+
+ case SDL_BUTTON_MIDDLE:
+ default:
+ printf("Mouse button %d pressed at (%d,%d)\n",
+ event.button.button, event.button.x, event.button.y);
+
+ }
+ break;
+
+ case SDL_MOUSEBUTTONUP:
+ switch (event.button.button) {
+
+ case SDL_BUTTON_LEFT:
+ fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_1,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ break;
+
+ case SDL_BUTTON_RIGHT:
+ fb_rootwindow_click(g, BROWSER_MOUSE_CLICK_2,
+ fb_cursor_x(framebuffer),
+ fb_cursor_y(framebuffer));
+ break;
+
+ default:
+ printf("Mouse button %d pressed at (%d,%d)\n",
+ event.button.button, event.button.x, event.button.y);
+
+ }
+ break;
+
+ case SDL_QUIT:
+ browser_window_destroy(g->bw);
+ }
*/
}
@@ -332,4 +365,3 @@
* c-basic-offset:8
* End:
*/
-
Modified: trunk/netsurf/framebuffer/fb_options.h
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_options.h?...
==============================================================================
--- trunk/netsurf/framebuffer/fb_options.h (original)
+++ trunk/netsurf/framebuffer/fb_options.h Thu Feb 26 12:58:03 2009
@@ -21,21 +21,24 @@
#include "desktop/options.h"
-extern char *option_fb_mode;
+extern int option_fb_depth;
+extern int option_fb_refresh;
extern char *option_fb_device;
extern char *option_fb_input_devpath;
extern char *option_fb_input_glob;
#define EXTRA_OPTION_DEFINE \
- char *option_fb_mode = 0; \
+ int option_fb_depth = 32; \
+ int option_fb_refresh = 70; \
char *option_fb_device = 0; \
char *option_fb_input_devpath = 0; \
char *option_fb_input_glob = 0;
-#define EXTRA_OPTION_TABLE \
- { "fb_mode", OPTION_STRING, &option_fb_mode }, \
- { "fb_device", OPTION_STRING, &option_fb_device }, \
- { "fb_input_devpath", OPTION_STRING, &option_fb_input_devpath }, \
- { "fb_input_glob", OPTION_STRING, &option_fb_input_glob },
+#define EXTRA_OPTION_TABLE \
+ { "fb_depth", OPTION_INTEGER, &option_fb_depth }, \
+ { "fb_refresh", OPTION_INTEGER, &option_fb_refresh }, \
+ { "fb_device", OPTION_STRING, &option_fb_device }, \
+ { "fb_input_devpath", OPTION_STRING, &option_fb_input_devpath }, \
+ { "fb_input_glob", OPTION_STRING, &option_fb_input_glob },
#endif
14 years, 3 months
r6640 tlsa - in /trunk/netsurfweb/developers: contribute.en gsoc/2008ideas.en gsoc/2009ideas.en gsoc/index.en index.en publicity.en
by netsurf@semichrome.net
Author: tlsa
Date: Thu Feb 26 12:39:35 2009
New Revision: 6640
URL: http://source.netsurf-browser.org?rev=6640&view=rev
Log:
Update GSoC links.
Modified:
trunk/netsurfweb/developers/contribute.en
trunk/netsurfweb/developers/gsoc/2008ideas.en
trunk/netsurfweb/developers/gsoc/2009ideas.en
trunk/netsurfweb/developers/gsoc/index.en
trunk/netsurfweb/developers/index.en
trunk/netsurfweb/developers/publicity.en
Modified: trunk/netsurfweb/developers/contribute.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/developers/contribute....
==============================================================================
--- trunk/netsurfweb/developers/contribute.en (original)
+++ trunk/netsurfweb/developers/contribute.en Thu Feb 26 12:39:35 2009
@@ -19,7 +19,7 @@
<li><a href="/developers/">Development area</a>
<ul>
<li><a href="/developers/contribute">Contribution</a></li>
-<li><a href="/developers/gsoc">GSoC 2008</a></li>
+<li><a href="/developers/gsoc">GSoC</a></li>
</ul>
</li>
<li><a href="/webmasters/">Webmaster area</a></li>
Modified: trunk/netsurfweb/developers/gsoc/2008ideas.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/developers/gsoc/2008id...
==============================================================================
--- trunk/netsurfweb/developers/gsoc/2008ideas.en (original)
+++ trunk/netsurfweb/developers/gsoc/2008ideas.en Thu Feb 26 12:39:35 2009
@@ -18,7 +18,7 @@
<li><a href="/developers/">Development area</a>
<ul>
<li><a href="/developers/contribute">Contribution</a></li>
-<li><a href="/developers/gsoc">GSoC 2008</a></li>
+<li><a href="/developers/gsoc">GSoC</a></li>
</ul>
</li>
<li><a href="/webmasters/">Webmaster area</a></li>
Modified: trunk/netsurfweb/developers/gsoc/2009ideas.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/developers/gsoc/2009id...
==============================================================================
--- trunk/netsurfweb/developers/gsoc/2009ideas.en (original)
+++ trunk/netsurfweb/developers/gsoc/2009ideas.en Thu Feb 26 12:39:35 2009
@@ -18,7 +18,7 @@
<li><a href="/developers/">Development area</a>
<ul>
<li><a href="/developers/contribute">Contribution</a></li>
-<li><a href="/developers/gsoc">GSoC 2008</a></li>
+<li><a href="/developers/gsoc">GSoC</a></li>
</ul>
</li>
<li><a href="/webmasters/">Webmaster area</a></li>
Modified: trunk/netsurfweb/developers/gsoc/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/developers/gsoc/index....
==============================================================================
--- trunk/netsurfweb/developers/gsoc/index.en (original)
+++ trunk/netsurfweb/developers/gsoc/index.en Thu Feb 26 12:39:35 2009
@@ -18,7 +18,7 @@
<li><a href="/developers/">Development area</a>
<ul>
<li><a href="/developers/contribute">Contribution</a></li>
-<li><a href="/developers/gsoc">GSoC 2008</a></li>
+<li><a href="/developers/gsoc">GSoC</a></li>
</ul>
</li>
<li><a href="/webmasters/">Webmaster area</a></li>
Modified: trunk/netsurfweb/developers/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/developers/index.en?re...
==============================================================================
--- trunk/netsurfweb/developers/index.en (original)
+++ trunk/netsurfweb/developers/index.en Thu Feb 26 12:39:35 2009
@@ -19,7 +19,7 @@
<li><a href="/developers/">Development area</a>
<ul>
<li><a href="/developers/contribute">Contribution</a></li>
-<li><a href="/developers/gsoc">GSoC 2008</a></li>
+<li><a href="/developers/gsoc">GSoC</a></li>
</ul>
</li>
<li><a href="/webmasters/">Webmaster area</a></li>
Modified: trunk/netsurfweb/developers/publicity.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/developers/publicity.e...
==============================================================================
--- trunk/netsurfweb/developers/publicity.en (original)
+++ trunk/netsurfweb/developers/publicity.en Thu Feb 26 12:39:35 2009
@@ -19,7 +19,7 @@
<li><a href="/developers/">Development area</a>
<ul>
<li><a href="/developers/contribute">Contribution</a></li>
-<li><a href="/developers/gsoc">GSoC 2008</a></li>
+<li><a href="/developers/gsoc">GSoC</a></li>
</ul>
</li>
<li><a href="/webmasters/">Webmaster area</a></li>
14 years, 3 months