r5381 vince - in /branches/vince/netsurf-fb: Makefile Makefile.sources css/css.h framebuffer/fb_16bpp_plotters.c framebuffer/fb_32bpp_plotters.c framebuffer/fb_8bpp_plotters.c framebuffer/fb_cursor.c framebuffer/fb_frontend_dummy.c

netsurf at semichrome.net netsurf at semichrome.net
Sat Sep 20 21:52:45 BST 2008


Author: vince
Date: Sat Sep 20 15:52:45 2008
New Revision: 5381

URL: http://source.netsurf-browser.org?rev=5381&view=rev
Log:
add dummy framebuffer

Added:
    branches/vince/netsurf-fb/framebuffer/fb_frontend_dummy.c
Modified:
    branches/vince/netsurf-fb/Makefile
    branches/vince/netsurf-fb/Makefile.sources
    branches/vince/netsurf-fb/css/css.h
    branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c
    branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c
    branches/vince/netsurf-fb/framebuffer/fb_8bpp_plotters.c
    branches/vince/netsurf-fb/framebuffer/fb_cursor.c

Modified: branches/vince/netsurf-fb/Makefile
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/Makefile?rev=5381&r1=5380&r2=5381&view=diff
==============================================================================
--- branches/vince/netsurf-fb/Makefile (original)
+++ branches/vince/netsurf-fb/Makefile Sat Sep 20 15:52:45 2008
@@ -463,12 +463,31 @@
     LDFLAGS += -lxml2 -lz -ljpeg -lcurl -lm 
     LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl openssl)
     SUBTARGET := -linux
-  else
+  endif
+
+  ifeq ($(NETSURF_FB_FRONTEND),able)
     $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,NetSurf GIF decoder))
     CC=arm-able-gcc
     CFLAGS += -std=c99 -I. -I/usr/lib/able/include -Dsmall $(WARNFLAGS)
     LDFLAGS += -lxml2 -lz -ljpeg -lcurl -lm 
     SUBTARGET := -able
+  else
+    $(eval $(call pkg_config_find_and_add,RSVG,librsvg-2.0,SVG rendering))
+    $(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,RISC OS sprite rendering))
+    $(eval $(call pkg_config_find_and_add,HUBBUB,libhubbub,Hubbub HTML parser))
+    $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,NetSurf BMP decoder))
+    $(eval $(call pkg_config_find_and_add,GIF,libnsgif,NetSurf GIF decoder))
+
+
+    CFLAGS += -std=c99 -g -I. $(WARNFLAGS) \
+	 	 $(shell xml2-config --cflags) \
+		 -D_BSD_SOURCE \
+		 -D_XOPEN_SOURCE=600 \
+		 -D_POSIX_C_SOURCE=200112L 
+
+    LDFLAGS += -lxml2 -lz -ljpeg -lcurl -lm 
+    LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl openssl)
+    SUBTARGET := -dummy
   endif
 endif
 

Modified: branches/vince/netsurf-fb/Makefile.sources
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/Makefile.sources?rev=5381&r1=5380&r2=5381&view=diff
==============================================================================
--- branches/vince/netsurf-fb/Makefile.sources (original)
+++ branches/vince/netsurf-fb/Makefile.sources Sat Sep 20 15:52:45 2008
@@ -97,8 +97,11 @@
 
 ifeq ($(NETSURF_FB_FRONTEND),linux)
 S_FRAMEBUFFER += fb_frontend_linuxfb.c
+endif
+ifeq ($(NETSURF_FB_FRONTEND),able)
+S_FRAMEBUFFER += fb_frontend_ablefb.c
 else
-S_FRAMEBUFFER += fb_frontend_ablefb.c
+S_FRAMEBUFFER += fb_frontend_dummy.c
 endif
 
 S_FRAMEBUFFER := $(addprefix framebuffer/,$(S_FRAMEBUFFER))

Modified: branches/vince/netsurf-fb/css/css.h
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/css/css.h?rev=5381&r1=5380&r2=5381&view=diff
==============================================================================
--- branches/vince/netsurf-fb/css/css.h (original)
+++ branches/vince/netsurf-fb/css/css.h Sat Sep 20 15:52:45 2008
@@ -35,12 +35,13 @@
 #ifndef _NETSURF_CSS_CSS_H_
 #define _NETSURF_CSS_CSS_H_
 
+#include <stdint.h>
 #include <stdbool.h>
 #include <libxml/HTMLparser.h>
 #include "css/css_enum.h"
 
 
-typedef unsigned long colour;  /* 0xbbggrr */
+typedef uint32_t colour;  /* 0xbbggrr */
 #define TRANSPARENT 0x1000000
 #define CSS_COLOR_INHERIT 0x2000000
 #define CSS_COLOR_NONE 0x3000000

Modified: branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c?rev=5381&r1=5380&r2=5381&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c Sat Sep 20 15:52:45 2008
@@ -31,9 +31,9 @@
 #include "framebuffer/fb_font.h"
 
 static inline uint16_t *
-fb_16bpp_get_xy_loc(int x, int y, struct gui_window *g)
-{
-        return (uint16_t *)(framebuffer->ptr + 
+fb_16bpp_get_xy_loc(int x, int y)
+{
+        return (void *)(framebuffer->ptr + 
                             (y * framebuffer->linelen) + 
                             (x << 1));
 }
@@ -71,7 +71,7 @@
                 /*LOG(("horiz: %d, %d, %d, %d, %d, 0x%lx, %d, %d",
 		  x0,y0,x1,y1,width,c,dotted,dashed));*/
 
-                pvideo = fb_16bpp_get_xy_loc(x0, y0, current_window);
+                pvideo = fb_16bpp_get_xy_loc(x0, y0);
 
                 w = x1 - x0;
                 while (w-- > 0) {
@@ -96,9 +96,9 @@
                 sdy = dx ? SIGN(dy) * SIGN(dx) : SIGN(dy);
 
                 if (dx >= 0)
-                        pvideo = fb_16bpp_get_xy_loc(x0, y0, current_window);
+                        pvideo = fb_16bpp_get_xy_loc(x0, y0);
                 else
-                        pvideo = fb_16bpp_get_xy_loc(x1, y1, current_window);
+                        pvideo = fb_16bpp_get_xy_loc(x1, y1);
 
                 x = dyabs >> 1;
                 y = dxabs >> 1;
@@ -171,7 +171,7 @@
               ((c & 0xFC00 ) >> 5) |
               ((c & 0xF80000) >> 19);
 
-        pvideo = fb_16bpp_get_xy_loc(x0, y0, current_window);
+        pvideo = fb_16bpp_get_xy_loc(x0, y0);
 
         for (y = y0; y < y1; y++) {
                 w = x1 - x0;
@@ -250,7 +250,7 @@
                 if (x < fb_plot_ctx.x0) 
                         continue;
 
-                pvideo = fb_16bpp_get_xy_loc(x, y, current_window);
+                pvideo = fb_16bpp_get_xy_loc(x, y);
 
                 /* move our font-data to the correct position */
                 font_data = fb_font->data + (buffer[chr] * fb_font->height);
@@ -337,7 +337,7 @@
 	yoff = y0 - y;
 
         /* plot the image */
-        pvideo = fb_16bpp_get_xy_loc(x0, y0, current_window);
+        pvideo = fb_16bpp_get_xy_loc(x0, y0);
 
         for (yloop = 0; yloop < height; yloop++) {
                 for (xloop = 0; xloop < width; xloop++) {

Modified: branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c?rev=5381&r1=5380&r2=5381&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c Sat Sep 20 15:52:45 2008
@@ -31,7 +31,7 @@
 #include "framebuffer/fb_font.h"
 
 static inline uint32_t *
-fb_32bpp_get_xy_loc(int x, int y, struct gui_window *g)
+fb_32bpp_get_xy_loc(int x, int y)
 {
         return (uint32_t *)(framebuffer->ptr + 
                             (y * framebuffer->linelen) + 
@@ -78,7 +78,7 @@
 
         ent = ((c & 0xff0000) >> 16) | (c & 0xff00) | ((c & 0xff) << 16);
 
-        video_char_start = fb_32bpp_get_xy_loc(x0, y0, current_window);
+        video_char_start = fb_32bpp_get_xy_loc(x0, y0);
 
         for (y = y0; y < y1; y++) {
                 w = x1 - x0;
@@ -155,7 +155,7 @@
           x,y,style,length,text,length,bg,c));*/
 
         for (chr=0; chr < length; chr++) {
-                pvideo = fb_32bpp_get_xy_loc(x + (chr * (fb_font->width)), y, current_window);
+                pvideo = fb_32bpp_get_xy_loc(x + (chr * (fb_font->width)), y);
 
                 /* move our font-data to the correct position */
                 font_data = fb_font->data + (buffer[chr] * fb_font->height);
@@ -241,7 +241,7 @@
                 width = (x1 - x0);
 
         /* plot the image */
-        pvideo = fb_32bpp_get_xy_loc(x0, y0, current_window);
+        pvideo = fb_32bpp_get_xy_loc(x0, y0);
 
         for (yloop = 0; yloop < height; yloop++) {
                 for (xloop = 0; xloop < width; xloop++) {

Modified: branches/vince/netsurf-fb/framebuffer/fb_8bpp_plotters.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_8bpp_plotters.c?rev=5381&r1=5380&r2=5381&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_8bpp_plotters.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_8bpp_plotters.c Sat Sep 20 15:52:45 2008
@@ -31,7 +31,7 @@
 #include "framebuffer/fb_font.h"
 
 static inline uint8_t *
-fb_8bpp_get_xy_loc(int x, int y, struct gui_window *g)
+fb_8bpp_get_xy_loc(int x, int y)
 {
         return (uint8_t *)(framebuffer->ptr + 
                            (y * framebuffer->linelen) + 
@@ -105,7 +105,7 @@
 
         fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1);
 
-        pvideo = fb_8bpp_get_xy_loc(x0, y0, current_window);
+        pvideo = fb_8bpp_get_xy_loc(x0, y0);
 
         ent = find_closest_palette_entry(c);
 
@@ -156,16 +156,14 @@
         y-=(fb_font->height * 75)/100;
 
 
-        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));
+        LOG(("x %d, y %d, style %p, txt %.*s , len %zu, bg 0x%lx, fg 0x%lx",
+             x,y,style,(int)length,text,length,bg,c));
 
         fg_pent = find_closest_palette_entry(c);
         bg_pent = find_closest_palette_entry(bg);
 
         for (chr=0; chr < length; chr++) {
-                pvideo = fb_8bpp_get_xy_loc(x + (chr * (fb_font->width)), 
-                                            y, 
-                                            current_window);
+                pvideo = fb_8bpp_get_xy_loc(x + (chr * (fb_font->width)), y);
 
                 /* move our font-data to the correct position */
                 font_data = fb_font->data + (text[chr] * fb_font->height);
@@ -210,7 +208,7 @@
         colour abpixel; /* alphablended pixel */
         int xloop,yloop;
 
-        pvideo = fb_8bpp_get_xy_loc(x, y, current_window);
+        pvideo = fb_8bpp_get_xy_loc(x, y);
 
         for (yloop = 0; yloop < height; yloop++) {
                 for (xloop = 0; xloop < width; xloop++) {

Modified: branches/vince/netsurf-fb/framebuffer/fb_cursor.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_cursor.c?rev=5381&r1=5380&r2=5381&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_cursor.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_cursor.c Sat Sep 20 15:52:45 2008
@@ -28,6 +28,7 @@
 #include "utils/utf8.h"
 #include "desktop/plotters.h"
 #include "desktop/browser.h"
+#include "image/bitmap.h"
 
 #include "framebuffer/fb_gui.h"
 #include "framebuffer/fb_plotters.h"

Added: branches/vince/netsurf-fb/framebuffer/fb_frontend_dummy.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_frontend_dummy.c?rev=5381&view=auto
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_frontend_dummy.c (added)
+++ branches/vince/netsurf-fb/framebuffer/fb_frontend_dummy.c Sat Sep 20 15:52:45 2008
@@ -1,0 +1,79 @@
+/*
+ * Copyright 2008 Vincent Sanders <vince at simtec.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "css/css.h"
+#include "desktop/options.h"
+#include "desktop/gui.h"
+#include "desktop/options.h"
+#include "utils/messages.h"
+
+#include "framebuffer/fb_gui.h"
+#include "framebuffer/fb_plotters.h"
+#include "framebuffer/fb_frontend.h"
+
+#include "utils/log.h"
+
+#define FILE_PFX "/home/vince/netsurf/netsurf-fb/framebuffer/res/"
+
+framebuffer_t *fb_os_init(int argc, char** argv)
+{
+        framebuffer_t *newfb;
+
+        newfb = calloc(1, sizeof(framebuffer_t));
+
+        newfb->width = 800;
+        newfb->height = 600;
+        newfb->bpp = 16;
+        newfb->ptr = malloc((newfb->width * newfb->height * newfb->bpp) / 8);
+        newfb->linelen = (newfb->width * newfb->bpp) / 8;
+
+
+        /* load browser messages */
+        messages_load(FILE_PFX "messages");
+
+        /* load browser options */        
+	options_read(FILE_PFX "Options");
+
+
+        default_stylesheet_url = strdup("file://" FILE_PFX "default.css");
+
+        return newfb;
+}
+
+void fb_os_quit(framebuffer_t *fb)
+{
+        free(fb->ptr);
+}
+
+void fb_os_input(struct gui_window *g) 
+{
+}
+
+/*
+ * Local Variables:
+ * c-basic-offset:8
+ * End:
+ */
+




More information about the netsurf-commits mailing list