r5322 vince - in /branches/vince/netsurf-fb: ./ framebuffer/

netsurf at semichrome.net netsurf at semichrome.net
Mon Sep 15 15:55:02 BST 2008


Author: vince
Date: Mon Sep 15 09:55:01 2008
New Revision: 5322

URL: http://source.netsurf-browser.org?rev=5322&view=rev
Log:
Linux frontend operates

Modified:
    branches/vince/netsurf-fb/Makefile
    branches/vince/netsurf-fb/Makefile.sources
    branches/vince/netsurf-fb/framebuffer/fb_8bpp_plotters.c
    branches/vince/netsurf-fb/framebuffer/fb_bitmap.c
    branches/vince/netsurf-fb/framebuffer/fb_bitmap.h
    branches/vince/netsurf-fb/framebuffer/fb_font.c
    branches/vince/netsurf-fb/framebuffer/fb_gui.c
    branches/vince/netsurf-fb/framebuffer/fb_init_able.c
    branches/vince/netsurf-fb/framebuffer/fb_init_linux.c
    branches/vince/netsurf-fb/framebuffer/fb_plotters.c
    branches/vince/netsurf-fb/framebuffer/fb_schedule.c

Modified: branches/vince/netsurf-fb/Makefile
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/Makefile?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/Makefile (original)
+++ branches/vince/netsurf-fb/Makefile Mon Sep 15 09:55:01 2008
@@ -442,9 +442,18 @@
 
   $(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG support))
 
-  CC=arm-able-gcc
-  CFLAGS += -std=c99 -I. -I/usr/lib/able/include -Dsmall $(WARNFLAGS)
+#  CC=arm-able-gcc
+#  CFLAGS += -std=c99 -I. -I/usr/lib/able/include -Dsmall $(WARNFLAGS)
+#  LDFLAGS += -lxml2 -lz -ljpeg -lcurl -lm 
+  CC=gcc
+  CFLAGS += -std=c99 -I. -Dsmall $(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)
 endif
 
 # ----------------------------------------------------------------------------

Modified: branches/vince/netsurf-fb/Makefile.sources
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/Makefile.sources?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/Makefile.sources (original)
+++ branches/vince/netsurf-fb/Makefile.sources Mon Sep 15 09:55:01 2008
@@ -93,7 +93,8 @@
 	misc.c fb_bitmap.c fb_font.c font_8x16.c fb_filetype.c login.c \
 	fb_plotters.c fb_8bpp_plotters.c \
 	fb_16bpp_plotters.c fb_32bpp_plotters.c \
-	fb_init_able.c
+	fb_init_linux.c
+#	fb_init_able.c
 #fb_1bpp_plotters.c
 S_FRAMEBUFFER := $(addprefix framebuffer/,$(S_FRAMEBUFFER))
 

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=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_8bpp_plotters.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_8bpp_plotters.c Mon Sep 15 09:55:01 2008
@@ -90,7 +90,7 @@
         return best_col;
 }
 
-static colour calc_colour(u8_t c)
+static colour calc_colour(uint8_t c)
 {
         return framebuffer->palette[c];
 }
@@ -132,7 +132,7 @@
                  const char *text, size_t length, colour bg, colour c)
 {
         const struct fb_font_desc* fb_font = fb_get_font(style);
-        const u8_t *font_data;
+        const uint8_t *font_data;
         int xloop, yloop;
         unsigned char row;
         int fg_pent;
@@ -205,7 +205,7 @@
                     struct bitmap *bitmap, colour bg, 
                     struct content *content)
 {
-        u8_t *pvideo;
+        uint8_t *pvideo;
         colour *pixel = (colour *)bitmap->pixdata;
         colour abpixel; /* alphablended pixel */
         int xloop,yloop;

Modified: branches/vince/netsurf-fb/framebuffer/fb_bitmap.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_bitmap.c?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_bitmap.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_bitmap.c Mon Sep 15 09:55:01 2008
@@ -15,6 +15,9 @@
  * 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 <inttypes.h>
+#include <sys/types.h>
 
 #include "assert.h"
 #include "image/bitmap.h"

Modified: branches/vince/netsurf-fb/framebuffer/fb_bitmap.h
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_bitmap.h?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_bitmap.h (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_bitmap.h Mon Sep 15 09:55:01 2008
@@ -20,7 +20,6 @@
 #define FRAMEBUFFER_BITMAP_H
 
 struct bitmap {
-	uint32_t ignored;
 	uint32_t width;
 	uint32_t height;
 	uint8_t *pixdata;

Modified: branches/vince/netsurf-fb/framebuffer/fb_font.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_font.c?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_font.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_font.c Mon Sep 15 09:55:01 2008
@@ -16,6 +16,8 @@
  * 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 <inttypes.h>
 
 #include <assert.h>
 #include "css/css.h"

Modified: branches/vince/netsurf-fb/framebuffer/fb_gui.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_gui.c?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_gui.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_gui.c Mon Sep 15 09:55:01 2008
@@ -42,7 +42,8 @@
 framebuffer_t *framebuffer;
 
 //#define FILE_PFX "(cd0)/res/"
-#define FILE_PFX "(tftpboot)/"
+//#define FILE_PFX "(tftpboot)/"
+#define FILE_PFX "/home/vince/netsurf/netsurf-fb/gtk/res/"
 
 static void fb_redraw(struct gui_window *g)
 {

Modified: branches/vince/netsurf-fb/framebuffer/fb_init_able.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_init_able.c?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_init_able.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_init_able.c Mon Sep 15 09:55:01 2008
@@ -42,7 +42,7 @@
              fbinfo->name,
              fbinfo->screeninfo->bits_per_pixel));
 
-        newfb = calloc(1, sizeof(fb_info_t));
+        newfb = calloc(1, sizeof(framebuffer_t));
 
         newfb->width = fbinfo->screeninfo->xres;
         newfb->height = fbinfo->screeninfo->yres;

Modified: branches/vince/netsurf-fb/framebuffer/fb_init_linux.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_init_linux.c?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_init_linux.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_init_linux.c Mon Sep 15 09:55:01 2008
@@ -1,10 +1,12 @@
+#include <signal.h>
+#include <sys/types.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <termios.h>
-#include <signal.h>
 #include <errno.h>
 #include <setjmp.h>
 #include <sys/ioctl.h>
@@ -16,8 +18,6 @@
 #include <linux/vt.h>
 #include <linux/fb.h>
 
-#include <asm/page.h>
-
 #include "css/css.h"
 #include "framebuffer/fb_gui.h"
 #include "framebuffer/fb_plotters.h"
@@ -45,8 +45,8 @@
 static struct vt_mode            vt_omode;
 static struct termios            term;
 static struct fb_var_screeninfo  fb_ovar;
-static unsigned short            ored[256], ogreen[256], oblue[256];
-static struct fb_cmap            ocmap = { 0, 256, ored, ogreen, oblue };
+static unsigned short            ored[256], ogreen[256], oblue[256], otransp[256];
+static struct fb_cmap            ocmap = { 0, 256, ored, ogreen, oblue, otransp };
 
 /* -------------------------------------------------------------------- */
 /* devices                                                              */
@@ -84,7 +84,6 @@
 /* -------------------------------------------------------------------- */
 /* console switching                                                    */
 
-extern int debug;
 
 static void
 fb_switch_signal(int signal)
@@ -92,37 +91,29 @@
         if (signal == SIGUSR1) {
                 /* release */
                 fb_switch_state = FB_REL_REQ;
-                if (debug)
-                        write(2,"vt: SIGUSR1\n",12);
         }
         if (signal == SIGUSR2) {
                 /* acquisition */
                 fb_switch_state = FB_ACQ_REQ;
-                if (debug)
-                        write(2,"vt: SIGUSR2\n",12);
-        }
-}
-
-void
-fb_switch_release()
+        }
+}
+
+static void
+fb_switch_release(void)
 {
         ioctl(tty, VT_RELDISP, 1);
         fb_switch_state = FB_INACTIVE;
-        if (debug)
-                write(2,"vt: release\n",12);
-}
-
-void
-fb_switch_acquire()
+}
+
+static void
+fb_switch_acquire(void)
 {
         ioctl(tty, VT_RELDISP, VT_ACKACQ);
         fb_switch_state = FB_ACTIVE;
-        if (debug)
-                write(2,"vt: acquire\n",12);
-}
-
-int
-fb_switch_init()
+}
+
+static int
+fb_switch_init(void)
 {
         struct sigaction act,old;
 
@@ -319,6 +310,7 @@
 {
         char   fbdev[16];
         struct vt_stat vts;
+        long pm = ~(sysconf(_SC_PAGESIZE) - 1);
 
         dev_init();
         tty = 0;
@@ -395,7 +387,7 @@
                 goto err;
         }
 
-        fb_mem_offset = (unsigned long)(fb_fix.smem_start) & (~PAGE_MASK);
+        fb_mem_offset = (unsigned long)(fb_fix.smem_start) & (~pm);
         fb_mem = mmap(NULL,fb_fix.smem_len+fb_mem_offset,
                       PROT_READ|PROT_WRITE,MAP_SHARED,fb,0);
         if (-1L == (long)fb_mem) {
@@ -496,10 +488,10 @@
 framebuffer_t *fb_init_os(int argc, char** argv)
 {
         framebuffer_t *newfb;
-
-        fb_init("/dev/fb0", "800x600-60", 7);
-
-        newfb = calloc(1, sizeof(fb_info_t));
+int ploop;
+        fb_init("/dev/fb0", "800x600-70", 1);
+
+        newfb = calloc(1, sizeof(framebuffer_t));
 
         newfb->width = fb_var.xres;
         newfb->height = fb_var.yres;

Modified: branches/vince/netsurf-fb/framebuffer/fb_plotters.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_plotters.c?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_plotters.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_plotters.c Mon Sep 15 09:55:01 2008
@@ -19,7 +19,6 @@
 #include <sys/types.h>
 #include <string.h>
 #include <limits.h>
-#include <able/fb.h>
 
 #include "utils/utf8.h"
 #include "utils/log.h"

Modified: branches/vince/netsurf-fb/framebuffer/fb_schedule.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_schedule.c?rev=5322&r1=5321&r2=5322&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_schedule.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_schedule.c Mon Sep 15 09:55:01 2008
@@ -15,6 +15,9 @@
  * 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/time.h>
+#include <time.h>
 
 #include "desktop/browser.h"
 #include "framebuffer/fb_schedule.h"




More information about the netsurf-commits mailing list